-
Notifications
You must be signed in to change notification settings - Fork 25
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
Image derivative creation should not fail on ImageMagick warnings #107
Comments
Ew. Can you attach or link to a fixture file we can use to reproduce this error? Thanks, @scossu! |
Let me browse through the files that I have the right to publish... |
Much obliged. |
I can confirm this happens with certain images I try to process as well. Here's a gist that demonstrates the output which triggers the failure. In my case it is tied to some tags that Photoshop sticks in the EXIF metadata which ImageMagick does not consider valid. https://gist.github.com/narogers/318d7dcbd34e06ae69140dcfbd2963d4 If using mini_magick (https://rubygems.org/gems/mini_magick/versions/4.5.1) I have found a temporary workaround by setting whiny = false in the application configuration (https://github.com/minimagick/minimagick#troubleshooting). |
@narogers do you have any fixture images you may be able to contribute? bonus points for smaller files. ;) Alternatively, are you inclined to put in a PR for this issue? |
Sorry about the radio silence on my end, I have been testing. I notice inconsistent results on different IM version. Our production server has an older version of IM and returns an error, the newer one not. Also the error code is 1, which may be a real error that does not return a valid image. This is a related discussion including a sample file: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=16390 |
@narogers Your solution sounds more than temporary if the I would be interested in testing this option. Does this configuration change need any code change or is it something that I can override in my Sufia configuration? |
@scossu I just dropped it into one of my initializers along with the rest of my ImageMagick configuration settings. It should be a minimal change. https://github.com/ClevelandArtGIT/cma-archives/blob/master/config/initializers/mini_magick.rb#L10 |
Some TIFF files contain metadata that causes ImageMagick to exit with non-zero status. This causes the derivative job to fail.
This is my output from Sufia:
The
mogrify
command actually creates the correct derivative.As per IM documentation [1] missing tags like the ones in the example above produce a status code between 300 and 399. Codes below 400 are considered warnings that still produce a valid image. Therefore the function calling the IM wrapper should not throw an exception if the return code is less than 400.
[1] http://www.imagemagick.org/script/exception.php
The text was updated successfully, but these errors were encountered: