Preview Image Removal Bug??

Started by BenBurrows, June 26, 2014, 12:21:29 PM

Previous topic - Next topic

BenBurrows

I think I found a bug in that I tried 3 methods to remove the preview image, 2 just dont work and the third DOES work but the exif data would have you believe it did not, however, comparing the file size you can see that SOMETHING was removed.

Its probably simplest to just cut and paste the console input/output to demonstrate the issue.
The photo was taken with a Cannon PowerShot SX280 HS.
I wanted to simply remove the Preview Image and I was looking arround the forums to figure out how. I tried the -PreviewImage= from just reading the documentation but when that did not work I had to look harder.  The -MIE:PreviewImage= does not seem to work either. What does work is -trailer:all= when you look at the file size but if you do an exiftool image.jpg command you see the PreviewImage still listed with the original size (which very closely matches the size difference of the file after using the -trailer:all= option).
Looking through the forum I can see a bug in this area was fixed in v8.29.

Here are the commands I ran and the output. Hopefully that should make it really clear what the issue is.

C:\Data\Temp\Clockwise>C:\usr\local\bin\exiftool -ver
9.65

C:\Data\Temp\Clockwise>C:\usr\local\bin\exiftool -o 0degNoEmbed.jpg -PreviewImage= 0deg.jpg
    1 image files copied

C:\Data\Temp\Clockwise>del 0degNoEmbed.jpg

C:\Data\Temp\Clockwise>C:\usr\local\bin\exiftool -o 0degNoEmbed.jpg -MIE:PreviewImage= 0deg.jpg
    1 image files copied

C:\Data\Temp\Clockwise>del 0degNoEmbed.jpg

C:\Data\Temp\Clockwise>C:\usr\local\bin\exiftool -o 0degNoEmbed.jpg -trailer:all= 0deg.jpg
    1 image files created
   
C:\Data\Temp\Clockwise>C:\usr\local\bin\exiftool 0deg.jpg | grep Preview
Preview Image                   : (Binary data 385197 bytes, use -b option to extract)

C:\Data\Temp\Clockwise>C:\usr\local\bin\exiftool 0degNoEmbed.jpg | grep Preview
Preview Image                   : (Binary data 385197 bytes, use -b option to extract)

C:\Data\Temp\Clockwise>ls -l
-rw-rw-rw-   1 user     group     2566829 Jun 24 07:29 0deg.jpg
-rw-rw-rw-   1 user     group     2181269 Jun 26 14:25 0degNoEmbed.jpg

Phil Harvey

Unfortunately there are as many ways to store a preview image as a dog has fleas, which complicates things unnecessarily.

For the PowerShot SX280 HS, Canon uses the relatively recent MPF standard to store the preview.  ExifTool does not yet have the ability to edit MPF information, but you are still able to delete it.  The proper technique for doing this is:

exiftool -trailer:all= -mpf:all= FILE

If you just remove the trailer, ExifTool will still report the preview (but not be able to extract it) since it is referenced from the MPF segment.  So to properly delete it, you must also remove the MPF segment.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BenBurrows

Great, Thanks for the response.