Sony ARW ModifyDate not writable

Started by jotzet79, August 07, 2023, 02:29:20 AM

Previous topic - Next topic

jotzet79

Hello,

When I try to set the ModifyDate (oddly in IFD1 Group) of a SONY ARW File (ILCE7M4) I get a warning , and the value itself is not changed:


localhost:~# exiftool -ModifyDate+=1 /path/to/file.arw

[minor] Oversized SubIFD StripByteCounts (66007040 bytes, but expected 57756160) - /path/to/file.arw

Is this a bug, have I done something wrong?


Thank you,
Joachim

StarGeek

Quote from: jotzet79 on August 07, 2023, 02:29:20 AMIs this a bug, have I done something wrong?

Yes, it's a bug, but not with exiftool.  For some reason, some Sony cameras incorrectly write the ModifyDate to IFD1, though they should also be writing to the correct place in IFD0 as well.

Output using a sample I have on hand
C:\>exiftool -G1 -a -s -ModifyDate Y:/!temp/DSC00175.ARW
[IFD0]          ModifyDate                      : 2018:05:08 15:08:29
[IFD1]          ModifyDate                      : 2018:05:08 15:08:29

If you use the command in FAQ #3, it should show you that the IFD0 location was properly updated.

You have two choices here.  You can explicitly set the IFD1 location in addition to the regular location
exiftool -ModifyDate+=1 -IFD1:ModifyDate+=1 /path/to/file.arw

Or you can simply remove the incorrect location, though I would make sure that both are there.  Something like
exiftool -if '$IFD0:ModifyDate and $IFD1:ModifyDate' -IFD1:ModifyDate= /path/to/files/

It's very unlikely that there's a program that will even read the IFD1: location.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

jotzet79

Oh, wow - thanks for the pointers @StarGeek!

However I am wondering if exiftool then reads the 'wrong' Segment for putting all infos together for its "Composite"-Tags?


[System]        FileModifyDate                  : 2023:08:07 13:31:08+02:00
[System]        FileAccessDate                  : 2023:08:07 13:31:03+02:00
[System]        FileInodeChangeDate             : 2023:08:07 13:31:08+02:00
[IFD0]          ModifyDate                      : 2023:04:08 13:45:15
[ExifIFD]       DateTimeOriginal                : 2023:04:08 13:45:15
[ExifIFD]       CreateDate                      : 2023:04:08 13:45:15
[IFD1]          ModifyDate                      : 2023:04:08 12:45:15
[Composite]     SubSecCreateDate                : 2023:04:08 13:45:15.337+02:00
[Composite]     SubSecDateTimeOriginal          : 2023:04:08 13:45:15.337+02:00
[Composite]     SubSecModifyDate                : 2023:04:08 12:45:15.337+02:00


Phil Harvey

Could you post a sample showing this effect? (Or email it to me if you can't post it here: philharvey66 at gmail.com)  I get this with a sample here:

> exiftool a.jpg -time:all -G1 -a -s
[System]        FileModifyDate                  : 2023:08:07 08:08:33-04:00
[System]        FileAccessDate                  : 2023:08:07 08:10:38-04:00
[System]        FileInodeChangeDate             : 2023:08:07 08:08:33-04:00
[IFD0]          ModifyDate                      : 2000:01:02 03:04:05
[ExifIFD]       OffsetTime                      : +01:02
[ExifIFD]       SubSecTime                      : 678
[IFD1]          ModifyDate                      : 1999:09:09 09:09:09
[Composite]     SubSecModifyDate                : 2000:01:02 03:04:05.678+01:02

Also, what version of ExifTool are you using?

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

StarGeek

Phil, sent you a link to an example ARW file which uses IFD1:ModifyDate when creating the SubSecModifyDate tag.

Not my image so I couldn't attach it here, but it's quite likely that I grabbed it from a post here at some point.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

#5
Thanks StarGeek.  Right.  I should have tried this with an ARW not a JPG.

It works for JPG images because IFD0 is prioritized for this file type since IFD1 is a reduced-resolution thumbnail in a JPG.

But for ARW images it isn't as clear which one should be prioritized.  IFD0 and IFD1 are both reduced-resolution images.  Without any other rules, by default ExifTool prioritizes the last tag of a given name, which is what happens here.

> exiftool ~/Desktop/DSC00175.ARW -G1 -a -subfiletype
[IFD0]          Subfile Type                    : Reduced-resolution image
[SubIFD]        Subfile Type                    : Full-resolution image
[IFD1]          Subfile Type                    : Reduced-resolution image

Perhaps this isn't ideal, but since this code also affects all other TIFF-based file formats I worry about changing this behaviour now.  Edit: I figured out a way to patch this only for ARW images, so I will do this in the next release (12.65).

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

jotzet79

Great, thanks for providing your advise Stargeek, and thanks to your quick response & swift fix in the code base for the next release! I am looking forward to it, and support in testing of course.

Thank you,
Joachim

jotzet79

Quote from: jotzet79 on August 07, 2023, 02:48:43 PMGreat, thanks for providing your advise Stargeek, and thanks to your quick response & PHIL for the swift fix in the code base for the next release! I am looking forward to it, and support in testing of course.

Thank you,
Joachim

Important addition;)

However I wonder why the IFD1:ModifyDate has not been updated by my initial command. I thought that tags without a reference to a specific group will be updated amongst all groups a tag(name) belongs to? (my memories are based on extensive hobby works during the pandemics, so some might have gotten blurry already)
Thanks, J

Phil Harvey

In general, that is true (and true, this is what the documentation says), but the TIFF format is an exception because the specification allows different images in each IFD (eg. multiple pages), so it is possible that they each have unique metadata.

Metadata is messy.  And it gets worse because the TIFF format is used for so many other proprietary file types and they all bend/break the specification in different ways.

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