Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ImageAnalyzer incorrectly assumes that it can handle all images #36065
Steps to reproduce
the analyze job crashes
This happens because the ImageAnalyzer assumes that ImageMagic can handle all image types. Unfortunately it can't.
The blob correctly identifies a .heic file as an image based on the content_type (image/heic)
The ImageAnalyzer incorrectly assumes that it can handle all images and sends things off to ImageMagic
ImageMagic (as of 6.9.7-4) can't handle .heic files, so it throws an error which means that sidekiq re-enqueues the job a bunch of times.
For the specific case of .heic, at some point my Ubuntu repo will end up with a more up-to-date version of ImageMagik which can handle the file, however there is always going to be a new image file (or an old one) that it can't handle.
It would seem like a good idea to provide some kind of config option for the ImageAnalyzer allowing users to override specific cases (e.g. don't try to analyze
referenced this issue
Apr 23, 2019
I saw that we handle the
I put up a quick PR for this to see what the general feeling is on that approach.
As for a workaround you can
I'm not sure how valuable it is to make this behaviour configurable.
My solution for now is to create a custom HeicAnalyzer that accepts
I'm not sure what the 'right' approach is - but it seems 'wrong' to have an image analyzer which is kicked off automatically, and repeatedly crashes for some kinds of images
Given that the Image Analyzer does explicitly depend on ImageMagick - and ImageMagick can't handle all image files, it seems like it should handle the failure case more gracefully.
You're probably right that configuration makes little sense - perhaps the Analyzer should just return different metadata
edit: I belatedly spotted at your pull request; That looks like a much better approach.