Question to deleting ThumbnailImage and PreviewImage

Started by herb, August 19, 2010, 12:42:37 PM

Previous topic - Next topic

herb

Hello everybody,

I have a *.jpg image file (from my Olympus camera) that contains both the ThumbnailImage and the PreviewImage.
Displaying all tags the Composite tags show that both exist.
They can be deleted with 
     exiftool -ThumbnailImage= -PreviewImage= image.jpg

I also did a backup of all tags into an image.MIE file:
     exiftool -tagsfromfile image.jpg -All image.mie
Then I deleted both ThumbnailImage and PreviewImage inside the image.MIE file:
     exiftool -ThumbnailImage= -PreviewImage= image.mie

Now the display of all tags says within Composite tags: PreviewImage 0 byte. Use -b ....
For me it is that the tag PreviewImage still exists (with 0 byte).
I think it should not exist anymore.
Did I something wrong?

Best regards
Herb

Phil Harvey

Hi Herb,

From the exiftool application documentation:

Quote
            Note:  MakerNotes tags may be edited, but not created or deleted
            individually. This avoids many potential problems including the
            inevitable compatibility problems with OEM software which may be
            very inflexible about the information it expects to find in the
            maker notes.

I think you will find that the PreviewImage is stored in the maker notes in this file, so the tags which refer to the preview image are zeroed since they can't be deleted.

- 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 ($).

Storhaug

QuoteThey can be deleted with
     exiftool -ThumbnailImage= -PreviewImage= image.jpg

To remove thumbnails completely, use:

exiftool -ThumbnailImage= -ifd1:all= image.jpg

I forgot the reason for -ifd1:all=
Phil, please help me out.

Phil Harvey

Quote from: Storhaug on August 20, 2010, 05:51:40 AM
To remove thumbnails completely, use:

exiftool -ThumbnailImage= -ifd1:all= image.jpg

I forgot the reason for -ifd1:all=
Phil, please help me out.

Good point.  In JPEG images, IFD1 stores the thumbnail image and its attributes (x/yresolution, etc), so without the image itself other IFD1 tags don't make much sense.

- 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 ($).

herb

Hello everybody,

thank you very much for your hints and comments. They are really very helpful.

But I think there is a misunderstanding. Sorry, maybe I did not describe my question detailed enough.
I copied the tags ThumbnailImage and PreviewImage into a *.MIE file and I tried to delete them in this image.mie file.

So I talk about the tags: -MIE:Thumbnailimage and -MIE:PreviewImage.
After deleting them with
   exiftool -ThumbnailImage= -PreviewImage= image.mie
the tag MIE:PreviewImage remains.

Is this really correct?

Best Regards
Herb

Phil Harvey

Hi Herb,

I understood you perfectly (I think).

The MIE file format can store all other types of metadata.

Deleting PreviewImage will delete the MIE:PreviewImage, but Composite:PreviewImage (derived from MakerNotes:PreviewImageStart and MakerNotes:PreviewImageLength) or MakerNotes:PreviewImage may still remain (with zero length).

Use the -G option when extracting to see which one remains.  If it is MIE:PreviewImage, there is something wrong and I want to know about it.

- 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 ($).

herb

Hello Phil,

thanks for yor answer.
As described in previous posts I copy the ThumbnailImage and the PreviewImage from a jpg into a mie file
and then I delete it inside the mie file:
      exiftool -tagsfromfile "image.jpg" -All -ThumbnailImage -PreviewImage image.mie
    exiftool -ThumbnailImage= -PreviewImage= image.mie


The result of the display after the copy command is:

   [MIE]           Color Space                     : sRGB
   [MIE]           Components Configuration        : Y, Cb, Cr, -
   [MIE]           Resolution                      : 21(/in)
   [MIE]           Preview Image                   : (Binary data 57436 bytes, use -b option to extract)
   [MIE]           Thumbnail Image                 : (Binary data 5196 bytes, use -b option to extract)
   [XMP]           XMP Toolkit                     : Image::ExifTool 8.27
   [XMP]           Firmware                        : 76
   [XMP]           ... some more tags


And after the delete command

   [MIE]           Color Space                     : sRGB
   [MIE]           Components Configuration        : Y, Cb, Cr, -
   [MIE]           Resolution                      : 21(/in)
   [MIE]           Preview Image                   : (Binary data 0 bytes, use -b option to extract)
   [XMP]           XMP Toolkit                     : Image::ExifTool 8.27
   [XMP]           Firmware                        : 76
   [XMP]           ... some more tags


For me the MIE:PreviewImage tag should not exist anaymore after the delete command.

Best regards
Herb

Phil Harvey

#7
OK Herb, thanks.  This is a mystery that needs solving because this should work.

What version of ExifTool are you using, and what system (Mac, Windows, Linux?).

Also, could you post the MIE file which gives you this problem?

With this information I should be able to figure out what is going wrong.

Thanks.

- Phil

[edit] I have been able to reproduce this problem here, so I don't need a sample.  I will look into this and report back when I have a solution.
...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 ($).

Phil Harvey

Sorry for being so slow in picking up on the fact that there was a problem.  I was fooled because I tried -MIE:PreviewImage= and it worked fine, but just -PreviewImage= didn't.

I think I have now fixed the problem, and have released a new version of ExifTool (8.29) which should properly delete the MIE PreviewImage with -PreviewImage=.

Thanks for your persistence in helping me find this bug.

- 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 ($).

herb

Hello Phil,

sorry for my late reply. I was on vacation for some days.
I only want to say thank you very much for the correction in ExifTool 8.29.

Best Regards
Herb