Skip to content

Add support for automatic WebP -> PNG#58

Merged
ovsky merged 2 commits into
devfrom
feature/add-webp-to-png-conversion
Dec 5, 2025
Merged

Add support for automatic WebP -> PNG#58
ovsky merged 2 commits into
devfrom
feature/add-webp-to-png-conversion

Conversation

@ovsky
Copy link
Copy Markdown
Owner

@ovsky ovsky commented Dec 5, 2025

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:

  • Added a new setting convert_webp_to_png to UI::BrowserSettings and exposed it in the settings catalog, allowing users to enable or disable automatic WebP conversion. [1] [2]
  • Implemented a Windows-specific function ConvertWebPToPNG in DownloadManager.cpp using Windows Imaging Component (WIC) to convert WebP files to PNG after download completion.
  • Integrated the conversion workflow into 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:

  • Added SetWebPConversionCallback to DownloadManager to allow UI code to control whether conversion should occur, and stored the callback in the manager. [1] [2] [3]
  • Connected the new callback in both UI constructors so that the user's setting is respected during downloads. [1] [2]

Other:

  • Updated the fallback settings catalog size to accommodate the new setting.

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.

ovsky added 2 commits December 5, 2025 19:09
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.
@ovsky ovsky merged commit c75cc6e into dev Dec 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant