Options

Bulk Edit EXIF

StevenVStevenV Registered Users Posts: 1,174 Major grins
edited April 20, 2006 in Digital Darkroom
Anyone got a(n inexpensive) tool that will do changes to EXIF info in CRW files?

I must have jiggered the 10D's wheel when resetting the clock last week and bumped the month, so all my images from last week are tagged as being shot in May.

(I don't care if it's Win or Mac, I can get to the images from either platform)

Comments

  • Options
    cabbeycabbey Registered Users Posts: 1,053 Major grins
    edited April 14, 2006
    StevenV wrote:
    Anyone got a(n inexpensive) tool that will do changes to EXIF info in CRW files?

    I must have jiggered the 10D's wheel when resetting the clock last week and bumped the month, so all my images from last week are tagged as being shot in May.

    (I don't care if it's Win or Mac, I can get to the images from either platform)
    The exif tool from libexif is capable of setting values, however it does seem to also dork with some other stuff, so it's not a clean "just change these bytes and no others" opperation. Namely on my images it mucks around with the Maker Note and User Comment portions. That at least works on my jpgs, it isn't capable of reading exif headers from my cr2 files... dunno if it would work on your crw files. If it can read them then that should work. You should be able to build that project on your mac.

    Here's an example of using it to change one of the three date tags in one of my images:
    cabbey@tweedle ~/scratch/tmp $ exif -t 0x9003 img_0005.jpg 
    EXIF entry 'Date and Time (original)' (0x9003, 'Date and Time (original)') exists in IFD 'EXIF':
    Tag: 0x9003 ('DateTimeOriginal')
      Format: 2 ('Ascii')
      Components: 20
      Size: 20
      Value: 2005:05:07 22:01:26
    cabbey@tweedle ~/scratch/tmp $ exif --ifd=EXIF -t 0x9003 --set-value="2010:01:01 23:59:59" img_0005.jpg 
    Wrote file 'img_0005.jpg.modified.jpeg'.
    
    Alternately, if you don't mind a little hackery... it can likely be done from a command line with perl. :) A quick test to see if it will work would be to do the following on your mac, in a terminal session:
    madhatter:/Network/Vault/pix/20D/raws cabbey$ strings img_0011.cr2 | grep 2005:05
    2005:05:07 22:25:00
    2005:05:07 22:25:00
    2005:05:07 22:25:00
    madhatter:/Network/Vault/pix/20D/raws cabbey$ 
    


    Since there were only three lines, and all three of them are dates, then it's safe to bruteforce the data. Had there been any other hits, then that would be an indication that the same byte pattern that represents the date just happens to also occur in the image data, so what I'm about to do would damage the image. And of course it's possible that there aren't any hits at all, because the crw files are too different from normal standards... I forget just how far off reality they are though.

    If that will work, then here's an example of doing it. The magic bits between the three / characters are basically: /wrong_date/correct_date/, you could specify it all the way down to the day, hour, etc... with something like ... -e "s/2005:05:07 22:25:00/2005:04:07 22:25:00/g" ... instead... but that would require you to change it for every shot, where as this just let's you do it with the same command line for all of them (pretty much).
    madhatter:/Network/Vault/pix/20D/raws cabbey$ perl -pi.ORIGINAL -es/2005:05/2005:04/g img_0011.cr2 
    madhatter:/Network/Vault/pix/20D/raws cabbey$ 
    
    Now that created a backup file called "img_0011.cr2.ORIGINAL" so I'll do a comparison of before and after, to validate that I only changed what I wanted to change...
    madhatter:/Network/Vault/pix/20D/raws cabbey$ hexdump -C img_0011.cr2.ORIGINAL > before
    madhatter:/Network/Vault/pix/20D/raws cabbey$ hexdump -C img_0011.cr2 > after          
    madhatter:/Network/Vault/pix/20D/raws cabbey$ diff -u before after
    --- before      2006-04-13 23:11:38.000000000 -0500
    +++ after       2006-04-13 23:11:51.000000000 -0500
    @@ -14,7 +14,7 @@
     000000d0  45 4f 53 20 32 30 44 00  cc 8c c8 c4 33 33 32 33  |EOS 20D.....3323|
     000000e0  13 03 01 33 33 33 33 13  33 13 48 00 00 00 01 00  |...3333.3.H.....|
     000000f0  00 00 48 00 00 00 01 00  00 00 32 30 30 35 3a 30  |..H.......2005:0|
    -00000100  35 3a 30 37 20 32 32 3a  32 35 3a 30 30 00 1c 00  |5:07 22:25:00...|
    +00000100  34 3a 30 37 20 32 32 3a  32 35 3a 30 30 00 1c 00  |4:07 22:25:00...|
     00000110  9a 82 05 00 01 00 00 00  64 02 00 00 9d 82 05 00  |........d.......|
     00000120  01 00 00 00 6c 02 00 00  22 88 03 00 01 00 00 00  |....l...".......|
     00000130  04 00 33 33 27 88 03 00  01 00 00 00 64 00 cc 4c  |..33'.......d..L|
    @@ -37,8 +37,8 @@
     00000240  01 00 00 00 00 00 00 00  03 a4 03 00 01 00 00 00  |................|
     00000250  00 00 00 00 06 a4 03 00  01 00 00 00 00 00 00 00  |................|
     00000260  00 00 00 00 05 00 00 00  0a 00 00 00 3f 00 00 00  |............?...|
    -00000270  0a 00 00 00 32 30 30 35  3a 30 35 3a 30 37 20 32  |....2005:05:07 2|
    -00000280  32 3a 32 35 3a 30 30 00  32 30 30 35 3a 30 35 3a  |2:25:00.2005:05:|
    +00000270  0a 00 00 00 32 30 30 35  3a 30 34 3a 30 37 20 32  |....2005:04:07 2|
    +00000280  32 3a 32 35 3a 30 30 00  32 30 30 35 3a 30 34 3a  |2:25:00.2005:04:|
     00000290  30 37 20 32 32 3a 32 35  3a 30 30 00 00 00 01 00  |07 22:25:00.....|
     000002a0  00 00 01 00 8a 4f 05 00  00 00 01 00 00 00 00 00  |.....O..........|
     000002b0  02 00 00 00 37 00 00 00  01 00 00 00 18 00 01 00  |....7...........|
    
    Anyway, if you need some help with that, let me know... with a mac at hand you should be able to fix your shots from this mistake pretty easily, I managed to fix the entire set I had taken when the month was off by 5 a couple years ago... 08 instead of 03... in just a few minutes once i figured out what had happened.
    SmugMug Sorcerer - Engineering Team Champion for Commerce, Finance, Security, and Data Support
    http://wall-art.smugmug.com/
  • Options
    StevenVStevenV Registered Users Posts: 1,174 Major grins
    edited April 14, 2006
    cabbey wrote:
    Alternately, if you don't mind a little hackery... it can likely be done from a command line with perl. :)
    Doh! Of course it can... Anything can be done with a helping of Perl and a little help from The Force.

    Thanks Cabby, I'll dig through your example once I'm more awake (I was up doing battle until 4am) icon_pirate.gif
  • Options
    cabbeycabbey Registered Users Posts: 1,053 Major grins
    edited April 15, 2006
    Heh, wasn't sure if you were versed in the ways of the internet duct tape or not... looking at your blog, I'm gunna bet that pointer was all you'll need to clean those up. :)

    And can I suggest a pressure washer? seriously, you can sit on your front deck and drench them clear out to the curb, amazingly effective. Especially if you have the kind that doesn't turn on the pump untill you squeeze the trigger.
    SmugMug Sorcerer - Engineering Team Champion for Commerce, Finance, Security, and Data Support
    http://wall-art.smugmug.com/
  • Options
    StevenVStevenV Registered Users Posts: 1,174 Major grins
    edited April 20, 2006
    for future searchers... it also looks like PhotoMechanic can, see it's [FONT=Arial,Helvetica,Geneva,Swiss,SunSans-Regular]apply IPTC stationery [/FONT]feature.
Sign In or Register to comment.