Skip to content

Fixes #161, document ImageMagick dependencies on Ubuntu 24.04#180

Open
Stormheg wants to merge 8 commits intowagtail:mainfrom
Stormheg:fix/ubuntu-24-imagemagick
Open

Fixes #161, document ImageMagick dependencies on Ubuntu 24.04#180
Stormheg wants to merge 8 commits intowagtail:mainfrom
Stormheg:fix/ubuntu-24-imagemagick

Conversation

@Stormheg
Copy link
Member

Fixes #161

@Stormheg Stormheg force-pushed the fix/ubuntu-24-imagemagick branch from 8b87d98 to fd14765 Compare October 29, 2025 15:41
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 Stormheg marked this pull request as ready for review November 4, 2025 13:39
@Stormheg Stormheg requested a review from zerolab November 4, 2025 13:39
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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Comment on lines +393 to +395
self.skipTest(
"Ignoring test outcome due to known ImageMagick bug on Ubuntu 24.04"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to just ignore the assertion error on linux. This way the code is still being run and counts towards coverage.

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.

Adopt Ubuntu 24.04 image in GitHub Actions test workflow

2 participants