Add new port: imagemagick image manipulation library#51731
Draft
Greisby wants to merge 1 commit into
Draft
Conversation
Contributor
|
We have GraphicsMagick port. Note for maintainers to check that. |
Contributor
|
Are these PRs assisted by AI? Too many at once may discourage good reviews. |
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.
ImageMagick is a widely-used, battle-tested C/C++ library and tool suite for creating, editing, composing, and converting digital images.
It supports hundreds of image formats (JPEG, PNG, TIFF, WebP, HEIC, AVIF, OpenEXR, JPEG XL, …), color management, drawing, compositing, and transforms.
It may be used directly by FFmpeg (via the
image2demuxer/muxer and theoverlayfilter fallback), Ghostscript interop, and countless image-processing pipelines.Why this new vcpkg port?
There is currently no official
imagemagickport in vcpkg.This PR adds one from scratch, with full autotools support on Linux/macOS/Windows and specific fixes to make the MSVC/cl.exe toolchain work correctly under MSYS2.
Key additions vs. a naive autotools port:
IMPORTEDtargets (ImageMagick::Magick++,ImageMagick::MagickWand,ImageMagick::MagickCore) with compile-definitions automatically propagated to consumers#warning→#pragma messagefix for MSVC (cl.exe does not accept#warning)cl_wrapper.sh/lib_wrapper.shpair that translates GCC-style libtool invocations to MSVC-compatible flags so the standard autotools+libtool flow works with cl.exePort contents
Features
The port exposes a rich set of vcpkg features, all wired to explicit
--with-*/--without-*configure flags so no uncontrolled system-library discovery can occur.I think that I didn't forgot any of the dependencies already available in vcpkg.
Quantum depth (mutually exclusive, exactly one must be selected):
q8--with-quantum-depth=8q16--with-quantum-depth=16q32--with-quantum-depth=32Quantum depth is ABI-breaking:
q8,q16, andq32builds produce incompatible library variants (suffixQ8,Q16HDRI,Q32HDRI, …).Consumers must be compiled with the same depth.
Pixel processing:
hdrizero-configurationopenmpDelegate / format libraries:
bzip2lzmazstdjpegpngtiffwebplcmsxml2freetypefontconfigopenexropenjp2heifjxlrawjbigfftwpangoraqmrsvggvczipx11uhdrMeta-features (convenience bundles):
modern-formatsheif,jxl,webpprofessional-formatsopenexr,openjp2,rawPatches
0001-fix-zstd-pkgconfig-prefix.patch0002-fix-fallthrough-msvc-c-mode.patch[[fallthrough]])0003-fix-cppflags-crt-conflict.patchCPPFLAGSon MSVC0004-fix-uhdr-cpp-compat.patch0005-fix-warning-directive-msvc.patch#warningwith#pragma message(cl.exe requirement)0006-fix-winpathscript-init-order.patchCMake integration
The port installs a hand-crafted
imagemagick-config.cmakethat exposes:Available targets:
ImageMagick::MagickCore,ImageMagick::MagickWand,ImageMagick::Magick++.Platform support
I rely on the CIs of vcpkg to test the others…
Owner-Projectform.vcpkg.json, or explicitly disabled through patches or build system arguments such as CMAKE_DISABLE_FIND_PACKAGE_Xxx or VCPKG_LOCK_FIND_PACKAGEvcpkg.jsonmatches what upstream says.vcpkg.jsonmatches what upstream says../vcpkg x-add-version --alland committing the result.