Go happily refuses to open JPEGs if they contain any glitches. As a user with such files, you still want to index and view them. It would therefore make sense to automate the repair of JPEGs, especially since the process is always the same.
Step 1: Use GraphicsMagick to check a JPEG for issues
GraphicsMagick is a great tool for this task. Depending on what operating system you are using, you may need to install it first: http://www.graphicsmagick.org/identify.html
Now run this command and check the report for any problems:
gm identify -verbose broken.jpg
Note that ImageMagick may also have a command for this. This describes the specific process I used and that worked for me. There are variants and it can likely be optimized so that fewer tools and libraries need to be installed.
Step 2: Use the ImageMagick convert command to create a valid copy of the image
To create a valid copy of the original JPEG:
convert broken.jpg fixed.jpg
Any glitches should then be fixed i.e. the repaired copy fixed.jpg can be opened without problems.
Related Issues:
Go happily refuses to open JPEGs if they contain any glitches. As a user with such files, you still want to index and view them. It would therefore make sense to automate the repair of JPEGs, especially since the process is always the same.
Step 1: Use GraphicsMagick to check a JPEG for issues
GraphicsMagick is a great tool for this task. Depending on what operating system you are using, you may need to install it first: http://www.graphicsmagick.org/identify.html
Now run this command and check the report for any problems:
Note that ImageMagick may also have a command for this. This describes the specific process I used and that worked for me. There are variants and it can likely be optimized so that fewer tools and libraries need to be installed.
Step 2: Use the ImageMagick
convertcommand to create a valid copy of the imageTo create a valid copy of the original JPEG:
Any glitches should then be fixed i.e. the repaired copy
fixed.jpgcan be opened without problems.Related Issues: