Skip to content

WebP in project files#25339

Merged
vadz merged 20 commits intowxWidgets:masterfrom
MaartenBent:webp-vcxproj
May 11, 2025
Merged

WebP in project files#25339
vadz merged 20 commits intowxWidgets:masterfrom
MaartenBent:webp-vcxproj

Conversation

@MaartenBent
Copy link
Contributor

An extension of #25205

I created a new webp project that is built by the Visual Studio solutions. It does not seem to need an compile or link options.

Because of the huge diff I put this in a separate PR to keep the other one readable.

This sets #define wxUSE_LIBWEBP 1 in all setup.h, so it might break some other builds.
Next step is to create webp.bkl so it is added to makefile.gcc and makefile.vc as well.

@MaartenBent
Copy link
Contributor Author

Xcode projects always defines HAVE_CONFIG_H, causing webp to look for a non-existing file.

WX_PREPROCESSOR_DEFINITIONS = WXBUILDING $(WXPLATFORM) __WX__ _FILE_OFFSET_BITS=64 _LARGE_FILES MACOS_CLASSIC __WXMAC_XCODE__=1 WX_PRECOMP=1 wxUSE_UNICODE_UTF8=0 wxUSE_UNICODE_WCHAR=1 HAVE_CONFIG_H PNG_NO_CONFIG_H

Adding just an empty src/web/config.h to the libwebp repo should fix this. But we need a libwebp repo for that.

@vadz can you fork https://github.com/webmproject/libwebp (or create a clone of https://chromium.googlesource.com/webm/libwebp), create a wx branch, and make it the default branch? Thanks.
With that, I should also be able to finalize #25205.

@vadz
Copy link
Contributor

vadz commented Apr 26, 2025

I guess the proper fix would be to use wxHAVE_CONFIG_H for our use (and the same for all the other HAVE_XXX, of course), but for now I've done what you proposed, i.e. created https://github.com/wxWidgets/libwebp/ with default wx branch.

TIA!

@MaartenBent
Copy link
Contributor Author

Thanks. Maybe before anyone thinks of using it, can you force the wx branch to tag v1.5.0 ?

@MaartenBent MaartenBent mentioned this pull request Apr 27, 2025
@MaartenBent MaartenBent force-pushed the webp-vcxproj branch 2 times, most recently from c626787 to 4c612e2 Compare April 27, 2025 16:54
hoehermann and others added 20 commits May 10, 2025 17:18
WebP sub-project searches for OpenGL, and sets the OpenGL variables to NOT_FOUND.
Make sure all OpenGL variables are updated when OpenGL dependency is set manually.
Add function to get the WebP library version.

Add LoadAnimation function to get all frame images, background colour and duration.

Use WebPAnimDecoder to decode frames other than the default (-1) frame.
This ensures all returned frames will have the same image size.
WebPDemuxGetFrame can return frames smaller than the full image size, but there is no way to get the offset of the frame.

Reduce code duplication when creating rgba image.

Add enum to store image format (undefined/mixed, lossy or lossless).
Add lossless and lossy quality options to wxImage for saving WebP.

Add wxBITMAP_TYPE_WEBP_RESOURCE because all other image handlers have this too.
Improve high-dpi support.
Run upmake, bakefile_gen, makeprojects.py, update-setup-h, autogen.
@MaartenBent MaartenBent changed the title WebP in MSVC solutions WebP in project files May 10, 2025
@MaartenBent MaartenBent marked this pull request as ready for review May 10, 2025 17:37
@vadz vadz merged commit fb09ee2 into wxWidgets:master May 11, 2025
41 checks passed
@MaartenBent MaartenBent deleted the webp-vcxproj branch November 16, 2025 15:10
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.

4 participants