Author Topic: updating EXIF in files with questionable or nonexistent EXIF data  (Read 4566 times)

Offline ramblinwreck

  • Member
  • **
  • Posts: 56
    • View Profile
Hi,

[I'm running PM 4.6.2.1 (eval) on OSX 10.6.2.]

As I mentioned in an earlier post, I'm planning on leaving Aperture and using PM as a front-end for my workflow (I can live without the catalog function for now, since Spotlight searches work well and also because PM is able to open my entire image collection, about 10K images, into a single contact sheet without issue).

I have managed to export all my images files from Aperture with metadata intact. I had to jump through some hoops to get the star ratings to transfer, but I was able to make it work using tips I found on this support forum (i.e. utilized an unused IPTC field to carry the rating information from one app to the other).

One problem (not a PM problem, BTW) I found after exporting all my files from Aperture, is that for a small subset of files, the 'capture' time and date was lost. It was replaced with the time and date of the export from Aperture. I noticed that the affected files were restricted to a few different kinds of files:

(a) old JPGs generated from a scanner, about 10 years ago
(b) scanned JPGs supplied by "1 hour photo" place after getting film developed
(c) JPGs generated from pre 2006 era mobile phone cameras

After some discussion on another forum, and some experimentation, I strongly suspect that these files either do not have EXIF data, or do not have properly written EXIF data. I guess that the original file creation date/time (e.g. from many years ago) was being used as the capture time, in lieu of having proper EXIF data. As such, when I export, the file creation time gets updated, and hence the only indication of the original file time and date is lost.

Assuming I can manually extract these old JPGs from my Aperture package file (thus preserving the original file creation date, e.g. using move rather than copy), I'm trying to find some way of automatically updating the EXIF capture time with the file creation time.

Someone suggested I might use 'exiftool' to help with this.

My question is - does PM have any functions to perform such a task? I see there is an "Adjust Capture Dates and Times" function, but I'm not clear if this will help me. It seems this is for correcting times/dates in a file when it is present, but wrong. In my case, I'm not sure there is even EXIF data present. It also seems that this tool cannot use the current file creation date to update the EXIF Capture data/time. (?)





Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #1 on: December 14, 2009, 09:50:48 AM »
One problem (not a PM problem, BTW) I found after exporting all my files from Aperture, is that for a small subset of files, the 'capture' time and date was lost. It was replaced with the time and date of the export from Aperture. I noticed that the affected files were restricted to a few different kinds of files:

(a) old JPGs generated from a scanner, about 10 years ago
(b) scanned JPGs supplied by "1 hour photo" place after getting film developed
(c) JPGs generated from pre 2006 era mobile phone cameras

After some discussion on another forum, and some experimentation, I strongly suspect that these files either do not have EXIF data, or do not have properly written EXIF data. I guess that the original file creation date/time (e.g. from many years ago) was being used as the capture time, in lieu of having proper EXIF data. As such, when I export, the file creation time gets updated, and hence the only indication of the original file time and date is lost.

Assuming I can manually extract these old JPGs from my Aperture package file (thus preserving the original file creation date, e.g. using move rather than copy), I'm trying to find some way of automatically updating the EXIF capture time with the file creation time.

Someone suggested I might use 'exiftool' to help with this.

My question is - does PM have any functions to perform such a task? I see there is an "Adjust Capture Dates and Times" function, but I'm not clear if this will help me. It seems this is for correcting times/dates in a file when it is present, but wrong. In my case, I'm not sure there is even EXIF data present. It also seems that this tool cannot use the current file creation date to update the EXIF Capture data/time. (?)

I think the Adjust Capture Dates and Times dialog will work for you though I'd have to test with one of your images to be sure.  When there is no EXIF data in a file, the Capture Date/Time will come from the file system's creation time for the photo.  If the file system doesn't support creation time, then the modification time will be used as the Capture Date/Time.

Now, what I'm unsure of is whether PM will create an entirely new EXIF block in your files because you've adjusted the time.  That would need testing with one of your files.  If you want to send me a sample file, click on my name to the left of this message, then click on the 'personal message' link.  I will respond with upload instructions.

-Kirk

Offline ramblinwreck

  • Member
  • **
  • Posts: 56
    • View Profile
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #2 on: December 14, 2009, 10:15:49 AM »
Hi Kirk,

Thanks for the quick reply.

I won't be able to send you a test file until this evening, but one question first:

Assuming for the moment that PM can do this for me (i.e. lets assume it will create a new EXIF block in response to a date/time adjust), could it do it in an automated fashion, or will I have to manually set the desired date & time for each image using the Adjust Capture Dates and Times dialog?

I think I've got about 400+ JPGs that fall into this category, so while not impossible, it would be impractical for me to update each one of these manually (hence, scripting with exiftool may still be an option...).

For example, could I load these 400+ JPGs into a contact sheet, and then somehow have PM perform a 'batch' update of all 400+ JPGs, which writes the EXIF block and sets the EXIF capture time to match the file creation time for all 400+ files all at once? I realize this may be wishful thinking here. :-)

Many thanks for the support.

Chris

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #3 on: December 14, 2009, 11:47:27 AM »
Chris,

Assuming for the moment that PM can do this for me (i.e. lets assume it will create a new EXIF block in response to a date/time adjust), could it do it in an automated fashion, or will I have to manually set the desired date & time for each image using the Adjust Capture Dates and Times dialog?

I think I've got about 400+ JPGs that fall into this category, so while not impossible, it would be impractical for me to update each one of these manually (hence, scripting with exiftool may still be an option...).

For example, could I load these 400+ JPGs into a contact sheet, and then somehow have PM perform a 'batch' update of all 400+ JPGs, which writes the EXIF block and sets the EXIF capture time to match the file creation time for all 400+ files all at once? I realize this may be wishful thinking here. :-)

The Adjust Capture Dates and Times dialog operates on a selection of photos, yes.

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #4 on: December 14, 2009, 09:16:08 PM »
Chris,

I uploaded one small test file: Flattop.jpg

It is a low quality JPG scan from roughly 10 years ago (scanner unknown).

OSX shows for me the Created and Modified dates as 8/12/98, 4:58PM.

If I "import" this to Aperture, then Aperture shows me an 'Image Date' of 8/12/98, where 'Image Date' is one of the EXIF fields that Aperture shows me. (I do not know whether Aperture is inferring this based on the filesystem creation date, or if it really thinks it has read valid EXIF data in this particular JPG).

It must be using the file system data.  The photo has no EXIF block in it whatsoever.

Quote from: ramblinwreck
If I "export" from Aperture (e.g. to Desktop), and then re-import to Aperture, then Aperture shows me an 'Image Date' which matches the time of export, and the 8/12/1998 date is lost. This is what I'm trying to avoid, I would like to preserve 8/12/98 as the original date, and was hoping PM might be able to help me with that.

I downloaded your example file and it got a creation/modification date of today.  When I used the Adjust Capture Dates and Times dialog, it showed the file system time/date and when I adjusted it, PM created a valid EXIF block in the file with the adjusted time (I changed the year back by one.)

Quote from: ramblinwreck
As discussed perhaps this is because this particular file has improper/incomplete EXIF data, or none at all.

Can I use PM to update the EXIF capture time using the file creation time? If so, can you give me explicit instructions on how to do so. I tried the 'Update Capture Dates and Times' dialog... specifically, I:

- selected the image in a contact sheet
- Tools -> Update Capture Dates and Times
- ticked all 3 boxes (Update file creation date/time, file modification date/time, IPTC/XMP date time)
- observed that PM was showing 8/12/1998, 4:58:42PM in the dialog box
- clicked update photos

With this new updated photo, I tried the Aperture export/re-import experiment again and got the same result, i.e. the 8/12/98 date was lost. Perhaps the EXIF data is still simply not there?

Once I used Photo Mechanic, ExifTool showed the correct date/time (what I adjusted) in the newly created EXIF data.  Aperture may be at fault here.

Photo Mechanic isn't going to be able to solve the issue where when you export from Aperture the file system date/time is changed to the current date and time, but if you can reference the actual files before their file system date/time is modified then you should be able to accomplish your task.

HTH,

-Kirk

Offline ramblinwreck

  • Member
  • **
  • Posts: 56
    • View Profile
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #5 on: December 15, 2009, 07:54:34 AM »
Kirk,

Quote
When I used the Adjust Capture Dates and Times dialog, it showed the file system time/date and when I adjusted it, PM created a valid EXIF block in the file with the adjusted time (I changed the year back by one.)

OK - if I can make PM do that for me then I'll be a happy camper!

Quote
if you can reference the actual files before their file system date/time is modified then you should be able to accomplish your task.

I can - by drilling down into the Aperture library package and manually extracting those files. It is only use of the Aperture 'Export Masters' command that causes modification of the date/time. Also, PM (I think) makes my life easier here because it seems to be able to open one of Aperture's low-level packages (corresponding to one "project" in Aperture) into a contact sheet. So, I only have to manually extract roughly 10 of low-level packages rather than 400+ individual JPGs (all of which are encapsulated in their own directory per Aperture's database structure).

Quote
Once I used Photo Mechanic, ExifTool showed the correct date/time (what I adjusted) in the newly created EXIF data.  Aperture may be at fault here.

I wonder - in my experiement I did not actually change the file time in the 'Update Capture Dates and Times' dialog. Maybe I need to something like +/- 1 minute to actually get PM to detect a change and write the EXIF block?

I will try this out this evening and let you know the result.

It's looking like PM will be a 2009 Christmas present to me, from me.  :)

Chris




Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #6 on: December 15, 2009, 11:27:43 AM »
Chris,

Quote
When I used the Adjust Capture Dates and Times dialog, it showed the file system time/date and when I adjusted it, PM created a valid EXIF block in the file with the adjusted time (I changed the year back by one.)

OK - if I can make PM do that for me then I'll be a happy camper!

I misspoke.  I looked at the resulting file and no EXIF data was added.  An IPTC record with Date Created and Time Created fields were added.  That's what ExifTool was listing, not EXIF data.  PM did not manufacture a new EXIF block in the JPEG after all.

-Kirk

Offline ramblinwreck

  • Member
  • **
  • Posts: 56
    • View Profile
Re: updating EXIF in files with questionable or nonexistent EXIF data
« Reply #7 on: December 15, 2009, 12:23:22 PM »
OK, thanks for confirming. There appear to be lots of tools out there to do this, it would have been a "nice to have" if PM did this, but it's no dealbreaker. This is a one-off problem that I'm sure I can find a point solution for.

Thanks again for the support.
Chris