Add support for automatic WebP -> PNG#58
Merged
Conversation
Introduces automatic conversion of downloaded WebP files to PNG format on Windows using Windows Imaging Component (WIC). Adds a callback to control conversion behavior and updates download records accordingly, including cleanup of the original WebP file.
Introduces a new browser setting 'convert_webp_to_png' that allows automatic conversion of downloaded WebP images to PNG format for improved compatibility. Updates the settings catalog and download manager integration to support this feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for automatically converting downloaded WebP images to PNG format on Windows, improving compatibility for users who may not be able to view WebP files natively. The conversion is controlled by a new user setting, and the feature is integrated into the download management workflow. The most important changes are grouped below:
WebP to PNG Conversion Feature:
convert_webp_to_pngtoUI::BrowserSettingsand exposed it in the settings catalog, allowing users to enable or disable automatic WebP conversion. [1] [2]ConvertWebPToPNGinDownloadManager.cppusing Windows Imaging Component (WIC) to convert WebP files to PNG after download completion.DownloadManager::OnFinishDownload, updating the download record to point to the PNG file and removing the original WebP file if conversion is successful. [1] [2]Download Manager Integration:
SetWebPConversionCallbacktoDownloadManagerto allow UI code to control whether conversion should occur, and stored the callback in the manager. [1] [2] [3]Other:
These changes provide a seamless experience for users who prefer PNG images and ensure that downloaded images are compatible with a wider range of applications and viewers.