Fixes #161, document ImageMagick dependencies on Ubuntu 24.04#180
Open
Stormheg wants to merge 8 commits intowagtail:mainfrom
Open
Fixes #161, document ImageMagick dependencies on Ubuntu 24.04#180Stormheg wants to merge 8 commits intowagtail:mainfrom
Stormheg wants to merge 8 commits intowagtail:mainfrom
Conversation
8b87d98 to
fd14765
Compare
zerolab
reviewed
Oct 29, 2025
Checks system ImageMagick supports required formats and can run the testsuite.
fd14765 to
703a4a1
Compare
Our GitHub Actions Ubuntu 24.04 test runner is affected by a bug in the ImageMagick package it ships with. See https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/2098541 Revert this commit once above bug is fixed.
Stormheg
commented
Nov 4, 2025
Comment on lines
+22
to
63
| if "--check-wand" in args: | ||
| from willow.plugins.wand import WandImage | ||
|
|
||
| args.remove("--check-wand") | ||
|
|
||
| jpeg_supported = WandImage.is_format_supported("JPEG") | ||
| png_supported = WandImage.is_format_supported("PNG") | ||
| gif_supported = WandImage.is_format_supported("GIF") | ||
| webp_supported = WandImage.is_format_supported("WEBP") | ||
| avif_supported = WandImage.is_format_supported("AVIF") | ||
|
|
||
| sys.stdout.write("\nChecking ImageMagick format support via Wand plugin:\n") | ||
|
|
||
| sys.stdout.write(f" JPEG support: {'yes' if jpeg_supported else 'no'}\n") | ||
| sys.stdout.write(f" PNG support: {'yes' if png_supported else 'no'}\n") | ||
| sys.stdout.write(f" GIF support: {'yes' if gif_supported else 'no'}\n") | ||
| sys.stdout.write(f" WEBP support: {'yes' if webp_supported else 'no'}\n") | ||
| sys.stdout.write(f" AVIF support: {'yes' if avif_supported else 'no'}\n") | ||
| if not all( | ||
| [ | ||
| jpeg_supported, | ||
| png_supported, | ||
| gif_supported, | ||
| webp_supported, | ||
| avif_supported, | ||
| ] | ||
| ): | ||
| sys.stdout.write( | ||
| "\nOne or more required formats are not supported by ImageMagick.\n" | ||
| ) | ||
| sys.stdout.write( | ||
| "This is likely an issue with your ImageMagick installation.\nIt may not be compiled with the correct features enabled.\n" | ||
| ) | ||
| sys.stdout.write( | ||
| "\nHint: check the output of `[convert|imagemagick] -list format` to see the formats supported\n" | ||
| "by your ImageMagick installation. The format must have 'rw+' to indicate read and write functionality.\n" | ||
| ) | ||
| sys.exit(1) | ||
| else: | ||
| sys.exit(0) | ||
|
|
||
| unittest.main(argv=args) |
Member
Author
There was a problem hiding this comment.
@zerolab do you feel this expanded format support check is worth it? I don't feel particularly strongly about keeping it, but it might be a useful debug aid if we ever end up having to debug Wand again.
Stormheg
commented
Nov 4, 2025
Comment on lines
+393
to
+395
| self.skipTest( | ||
| "Ignoring test outcome due to known ImageMagick bug on Ubuntu 24.04" | ||
| ) |
Member
Author
There was a problem hiding this comment.
I've decided to just ignore the assertion error on linux. This way the code is still being run and counts towards coverage.
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.
Fixes #161