Del last IFD0 tag + Concurrently set none-EXIF tag fails

Started by van Dusen, May 07, 2010, 07:35:10 PM

Previous topic - Next topic

van Dusen

Facts

When setting the very first EXIF tag (no EXIF tags present at all) to an image file, and the tag to be set belongs to IFD0 group, then ExifTool will automatically set some more IFD0 tags:
XResolution, YResolution, ResolutionUnit and YCbCrPositioning.
Example call:ExifTool.exe -EXIF:Artist="ThePhotographer" MyImage.jpg

You can "undo" this operation by deleting the "manually" set IFD0 tag from the image file, if this tag is the last EXIF/IFD0 tag (apart from above mentioned tags, which have been set automatically): the whole IFD0 group will be deleted from file
Example call:ExifTool.exe -EXIF:Artist= MyImage.jpg


Bug

But if you try to delete the "manually" set IFD0 tag from the image file and if you concurrently (with one ExifTool call) try to set a none-EXIF tag, then ExifTool keeps the file unchanged. Neither the EXIF tag / the IFD0 group will be deleted, nor the none-EXIF tag will be set/updated
Example call:ExifTool.exe -XMP:MetadataDate="2010:05:08 00:48:15" -EXIF:Artist= MyImage.jpg


Note

When deleting one of the automatically set IFD0 tags at first, then the bug will not arise
Example call:ExifTool.exe -EXIF:YCbCrPositioning= MyImage.jpg
ExifTool.exe -XMP:MetadataDate="2010:05:08 00:48:15" -EXIF:Artist= MyImage.jpg



Concerns ExifTool.exe v8.18 (didn't try older ExifTool versions so far) on Windows XP MCE SP3


P.S.: It's my first posting here, so I'd like to say: Thank you very much for this amazing tool! :)

Phil Harvey

#1
Quote from: van Dusen on May 07, 2010, 07:35:10 PM
Facts

When setting the very first EXIF tag (no EXIF tags present at all) to an image file, and the tag to be set belongs to IFD0 group, then ExifTool will automatically set some more IFD0 tags:

Yes. ExifTool writes some extra tags which are mandatory by the EXIF specification.

QuoteBut if you try to delete the "manually" set IFD0 tag from the image file and if you concurrently (with one ExifTool call) try to set a none-EXIF tag, then ExifTool keeps the file unchanged. Neither the EXIF tag / the IFD0 group will be deleted, nor the none-EXIF tag will be set/updated
Example call:ExifTool.exe -XMP:MetadataDate="2010:05:08 00:48:15" -EXIF:Artist= MyImage.jpg

It works fine for me:

> exiftool a.jpg -exif:all=
    1 image files updated

> exiftool a.jpg -exif:artist=me
    1 image files updated

> exiftool a.jpg -XMP:MetadataDate="2010:05:08 00:48:15" -EXIF:Artist= -v2
Writing XMP-xmp:MetadataDate
Deleting IFD0:Artist
======== a.jpg
Rewriting a.jpg...
  Editing tags in: APP0 APP1 IFD0 JFIF XMP
  Creating tags in: APP1 XMP
JPEG APP1 (96 bytes):
  Rewriting IFD0
  ExifByteOrder = MM
    - IFD0:Artist = 'me'
    - 4 mandatory tag(s)
  Deleting IFD0
  Deleting IFD0
  Deleting APP1 EXIF segment
JPEG APP1 (2839 bytes):
  Rewriting XMP
    - XMP-xmp:MetadataDate = '2010-05-08T00:48:15'
    + XMP-xmp:MetadataDate = '2010-05-08T00:48:15'
JPEG DQT (130 bytes):
JPEG SOF0:
JPEG DHT (73 bytes):
JPEG SOS
Copying Mac OS resource fork
Nothing changed in a.jpg
    0 image files updated
    1 image files unchanged


QuoteWhen deleting one of the automatically set IFD0 tags at first, then the bug will not arise
Example call:ExifTool.exe -EXIF:YCbCrPositioning= MyImage.jpg
ExifTool.exe -XMP:MetadataDate="2010:05:08 00:48:15" -EXIF:Artist= MyImage.jpg


Are you sure the YCbCrPositioning contained the default value?  ExifTool will only delete the mandatory tags if they contain the default values.

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

van Dusen

Hello Phil,

thanks for your reply!

I'm sorry to disagree with you, but it seems to work just as little for you:

Quote from: Phil Harvey on May 08, 2010, 05:45:40 AMIt works fine for me:
[...]
> exiftool a.jpg -XMP:MetadataDate="2010:05:08 00:48:15" -EXIF:Artist= -v2
[...]
Nothing changed in a.jpg
    0 image files updated
    1 image files unchanged

Just scan the EXIF- and XMP-tags of a.jpg after executing the above quoted command:
exiftool a.jpg -EXIF:All -XMP:All

You will find, that neither XMP:MetadataDate has been updated, nor EXIF:Artist (or complete IFD0-group, respectively) has been deleted.


May I trouble you to take a look at the problem once more? Thanks a lot in advance!

Phil Harvey

You're right.  Sorry, I missed that the file wasn't getting updated.  I'll look into this.

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

Phil Harvey

I found the problem and it will be fixed in the next release.

Thanks for pointing this out.

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

van Dusen

Successfully retested with ExifTool.exe v8.19
Thanks a lot for fixing the problem that fast, Phil! :)

Phil Harvey

Great, thanks for the confirmation.  And thanks again for reporting 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 ($).