After downloading all required packages that are needed to run blockhash on my system I kept encountering the message "Error opening image file «image»." I thought this was rather odd seeing how the images are not broken, and the program seems to report this for every image I tried to open.
After spending some time with gdb I came to the conclusion that an exception was being raised by ImageMagick, but this exception was completely ignored in the script's output. The exception I was a MissingDelegateError with the message "no decode delegate for this image format: JPG"
After a quick search the cause of this seems to be that some Linux distributions that offer ImageMagick and the dev packages don't include the delegates that ImageMagick provides when you build from source. -- I resolved the "Error opening image file «image»." issue by compiling the ImageMagick package (from here) again and verifying that it now did have the necessary delegates.
blockhash is now working as expected, but the error could really use some improvement! I spent close to two hours on resolving this issue, and a more detailed error message could really save other people this headache! (also see this page)
Steps I took to compile the delegates, for anyone who happens to stumble across this:
$ wget https://www.imagemagick.org/download/releases/ImageMagick-7.0.8-8.tar.gz
$ extract ImageMagick-7.0.8-8.tar.gz
$ cd ImageMagick-7.0.8-8
$ ./configure
$ make
$ buildpkg
After downloading all required packages that are needed to run blockhash on my system I kept encountering the message "Error opening image file «image»." I thought this was rather odd seeing how the images are not broken, and the program seems to report this for every image I tried to open.
After spending some time with gdb I came to the conclusion that an exception was being raised by ImageMagick, but this exception was completely ignored in the script's output. The exception I was a
MissingDelegateError
with the message "no decode delegate for this image format: JPG"After a quick search the cause of this seems to be that some Linux distributions that offer ImageMagick and the dev packages don't include the delegates that ImageMagick provides when you build from source. -- I resolved the "Error opening image file «image»." issue by compiling the ImageMagick package (from here) again and verifying that it now did have the necessary delegates.
blockhash is now working as expected, but the error could really use some improvement! I spent close to two hours on resolving this issue, and a more detailed error message could really save other people this headache! (also see this page)
Steps I took to compile the delegates, for anyone who happens to stumble across this: