Author Topic: Should XPComment changes affect Exif Byte Order and File Mod Time?  (Read 4422 times)

Archive

  • Newbie
  • *
  • Posts: 0
[Originally posted by odog502 on 2010-02-15 21:42:05.566329-08]

Im offering up some observations just in case the info helps your project.  Ive noticed some inconsistencies when changing XPComment with ExifTool vs using Windows XP Properties to manually change the comment(XPComment) on a JPG.  I noticed this while running the following command:

Code:
exiftool -P -overwrite_original -TagsFromFile C:\Temp\testfile.jpg -XPComment C:\Temp

Basically Im just copying the comment from one file to all the other files in a directory.  When I run this, the result by ExifTool looks correct.  The only properties that change in target files are:

XPComment

File Size

Thumbnail Offset.

However, if I change the comment on a JPG MANUALLY through Windows(right click on a JPG, click properties, type in a comment in the comment field) I get a different result.  In addition to the XPComment, File Size and Thumbnail Offset properties changing, the following properties change:

-Exif Byte Order changes from "big-endian" to "little-endian" if it is not already "little-endian"

-Interoperability Version property is deleted

-Interoperability Index property is deleted

-File Modification Date/Time is adjusted by +2 seconds, which is strange.  For example when I manually add a comment, if the File -Modification Date/Time is "2002:02:13 07:54:44-06:00" it will change to "2002:02:13 07:54:46-06:00".  This would make sense if it changed to the current date/time but its not.

This happens on JPGs from a variety of camera makes/models.

So the questions that comes to my mind are:

Is windows changing these additional properties due to a malfunction in windows?  Or is there a good reason why windows alters these other properties when XPComment is added?  Should ExifTool be altering any of these properties also?  For example, when the property XPComment is added to a JPG, should the Exif Byte Order change to "little endian"?

This isn't necessarily a problem with ExifTool.  I only bring it up to point out a difference in results using different methods.  It might be worth exploring, might not.  Just by the looks of it, I would say the ExifTool is behaving correctly and Windows is just corrupting fields.  Do you concur?

Im running Windows XP SP3 and using ExifTool 8.10

Archive

  • Newbie
  • *
  • Posts: 0
Re: Should XPComment changes affect Exif Byte Order and File Mod Time?
« Reply #1 on: May 12, 2010, 08:54:45 AM »
[Originally posted by exiftool on 2010-02-16 05:52:49.059496-08]

Yes, Windows is buggy.  In general I don't recommend using Windows
to edit metadata.  The main reason for this is that it has a long history
of corrupting maker note information.  Also, changing the byte order
of EXIF information is a HUGE NO-NO!!  There is no chance of avoiding
data loss or corruption if you do something stupid like this.

As well, Windows will intentionally delete some tags when writing others.
The only documentation I have seen on this subject is
here.
Of course, it doesn't mention anything about changing timestamps by
2 seconds or deleting interoperability tags.

ExifTool only writes what you tell it to.  There should be no unexpected
side-effects.

- Phil

Archive

  • Newbie
  • *
  • Posts: 0
Re: Should XPComment changes affect Exif Byte Order and File Mod Time?
« Reply #2 on: May 12, 2010, 08:54:45 AM »
[Originally posted by ryerman on 2010-02-16 09:29:24.741278-08]

I'm not a photographer but I have a large collection of JPG images (music album covers) that I tag and re-tag with ExifTool.  Your post seems to indicate that File Modification Date/Time is not changed when using ExifTool.  That made me very unhappy because my backup software uses date/time changes to identify files that have been edited.

However, I made a few tests using
Code:
exiftool -k -overwrite_original "-xpcomment=TEST CHANGES when xpcomment already exists" file.JPG
and found that File Modification Date/Time WAS updated correctly.  Phew!

I also used Windows Vista to manually change the xpcomment field and found that File Modification Date/Time WAS updated correctly and Exif Byte Order remained Big-endian.

I am not advocating the use of Windows to edit metadata and my tests were not thorough or comprehensive but maybe the difference is between Vista and XP.

I use Windows Vista SP2 and ExifTool 8.08

FYI

Jim

Archive

  • Newbie
  • *
  • Posts: 0
Re: Should XPComment changes affect Exif Byte Order and File Mod Time?
« Reply #3 on: May 12, 2010, 08:54:45 AM »
[Originally posted by exiftool on 2010-02-16 10:59:27.502072-08]

Hi Jim,

Thanks for pointing this out.  I had actually been thinking that
we were talking about a timestamp in the metadata, but I see
now that it was the system file modification date.

The filesystem information is handled differently from information
actually stored in the image:

By default exiftool does nothing special to try to preserve the
filesystem attributes when writing, so the System:FileModifyDate
will get set to the current time when a file is edited.  However, this
time may be preserved by using the -P option.  Other
filesystem attributes (such as icon position, etc) may also
change, but if you really need to preserve things these types
of things, the -overwrite_original_in_place option may
be used for this.

- Phil

Archive

  • Newbie
  • *
  • Posts: 0
Re: Should XPComment changes affect Exif Byte Order and File Mod Time?
« Reply #4 on: May 12, 2010, 08:54:45 AM »
[Originally posted by ryerman on 2010-02-16 11:33:38.922547-08]

Hi Phil,

Thanks for the information and for confirming that System:FileModifyDate is updated when editing.

I almost had a coronary when I read the original post!  I know little about metadata and less about digital photography but I enjoy monitoring the Image-ExifTool threads. Every now and then I learn something that helps with my project.

Jim

Archive

  • Newbie
  • *
  • Posts: 0
Re: Should XPComment changes affect Exif Byte Order and File Mod Time?
« Reply #5 on: May 12, 2010, 08:54:45 AM »
[Originally posted by odog502 on 2010-02-17 20:43:20.114721-08]

Phil, Thanks for the explanation.  That was exactly the information I was looking for.  I just wanted to make sure that you were aware of and could explain the differences in my results, and you did.  Im actually surprised that windows XP fails at a function as fundamental as changing file properties.  All my experiments I was doing with test copies of pics so I didn't corrupt any originals in the process.  After your explanation I feel safe using your ExifTool on my pics now.

Jim, just to clarify:  My file Modification times were NOT changing when using the ExifTool, but this was intentional.  If you look above at the command I was using, I included the "-P" flag(that Phil also mentioned) to keep this property from changing.

Jim's comment also got me curious to see if Vista and Windows 7 corrupt as much as XP does.  So I tried the same experiment on a vista and windows 7 machines and heres what I got when I MANUALLY changed the comments with those operating systems:

Windows 7

- File Modification Date/Time was changed(however, unlike XP it actually changed it to the correct current date)

- File size changed(duh) and XPComment changed(duh)

- Interoperability Index is still deleted

- Offset Schema and Padding properties are added

- Various thumbnail properties are altered

The results for Vista were the same as windows 7 except for the following:

- Vista did NOT delete the Interoperability property like win 7 did(strange)

- Vista adds an "about" property that has a hex value in it

- Vista adds a "user comment" property which is redundant to the "XPComment" property that it also adds.

So I guess in conclusion, Vista and 7 still seem to screw up the properties a little bit, but at least its not quite as bad as XP.

I will definitely only be using ExifTool for making any types of changes to my pics metadata.  Thanks for making this awesome tool, Phil.