Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise MiniMagick::Error if ImageMagick is missing delegates needed for image formats #2772

Conversation

danwilliams-fl
Copy link
Contributor

Fixes #2732

Starting in Alpine Linux 3.19, installing the imagemagick package no longer includes support for JPG, SVG, and other image formats. Additional packages must be installed to support each image format[1].

This means upgrading Alpine linux on a server can cause Carrierwave to start failing with CarrierWave::ProcessingError when uploading images.

The root cause isn't obvious from this error.

However when ImageMagick is not installed, Carrierwave raises MiniMagick::Error instead of CarrierWave::ProcessingError, and includes the detailed error message.

This PR also raises MiniMagick::Error if ImageMagick is installed but is missing the delegates required for the image format being manipulated. This will make it easier to debug when uploads are failing.

I see there was a previous attempted fix at #2733 and agree that following #2499 we do not want any end-user unfriendly text in CarrierWave::ProcessingError#message. As a result I have taken a different approach in this PR.

[1] https://maxsmolens.org/posts/imagemagick-packaging-change-on-alpine-linux/

Fixes #2732

Starting in Alpine Linux 3.19, installing the `imagemagick` package no
longer includes support for JPG, SVG, and other image formats.[1]

This means upgrading Alpine linux on a server can cause Carrierwave to
start failing with CarrierWave::ProcessingError when uploading images.

The root cause isn't obvious from this error.

However when ImageMagick is not installed, Carrierwave raises
MiniMagick::Error instead of CarrierWave::ProcessingError, and includes
the detailed error message.

This fix also raises MiniMagick::Error if ImageMagick is installed but
is missing the delegates required for the image format being
manipulated. This will make it easier to debug when uploads are failing.

[1] https://maxsmolens.org/posts/imagemagick-packaging-change-on-alpine-linux/
@mshibuya mshibuya merged commit b4d43c3 into carrierwaveuploader:master Jan 11, 2025
15 checks passed
@mshibuya
Copy link
Member

Looks good, thanks! 👍

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.

When failing to process with ImageMagick, could we include the actual processing ImageMagick error message?
2 participants