Inserting Owner Name into CameraData (Exif) field

Started by Archive, May 12, 2010, 08:53:50 AM

Previous topic - Next topic

Archive

[Originally posted by leprish on 2005-07-25 19:03:16-07]

I have a bunch of Canon 10D (CRW format) files where I forget to activate the Owner Name in the Camera Settings. I've downloaded Image-ExifTool and read the instructions but still can't figure out what it is I need to do to write this my name eg. "Leprish" into the Exif Owner Name field. I use Mac OSX and would very grateful for an example of what it is I need to be typing into Terminal. to achieve this. Also, is the process one file at a time or can I run a batch that will apply the the edit to all of the files?

Archive

[Originally posted by exiftool on 2005-07-25 23:55:38-07]

This can easily be done on a single file:

Code:
   exiftool -ownername='Leprish' '/Users/phil/Pictures/test.crw'

or on all the files in a directory hierarchy:

Code:
   exiftool -ownername='Leprish' -r '/Users/phil/Pictures'

Notes:

1) I have put quotes around the owner name and the file names so this same syntax will work if the names contain spaces.

2) Without the "-r" option, the 2nd example only modifies files in the "Pictures" directory, but not any sub-directories.

3) These examples assume that you have successfully installed ExifTool.  If not, all you need to do is download and expand the ExifTool distribution, then replace "exiftool" with  "~/Desktop/Image-ExifTool-5.46/exiftool" in the commands above (assuming that you downloaded verision 5.46 to your Desktop).

4) Make sure you are using version 5.46 or later, since this version fixes a bug in the CRW writing code.

Archive

[Originally posted by leprish on 2005-07-26 19:32:46-07]

Thanks that was a great help. The only downside of doing this appears to have been that the Photo EXIF date (time image was digitized) has been set to 00.51/ 01/ 1970  according to Better Finder Attributes ((OSX version). However, all other applications are showing the correct date and time for digitizing.

Archive

[Originally posted by exiftool on 2005-07-26 23:30:39-07]

I'll look into this Better Finder Attributes application and try this myself, but I'm assuming that this is reporting the Macintosh file creation time, which definitely does change with the procedure I outlined, but should change to the current date instead of 1970.

Try using the exiftool "-P" option which preserves the Unix system times for the file.  It may help, but I'm not sure how this relates to the time reported by Better Finder Attributes.

Archive

[Originally posted by exiftool on 2005-07-27 15:24:38-07]

I downloaded "A Better Finder Attributes" for OS X (hereafter abbreviated ABFA) and ran some tests.  The problem isn't related to the Macintosh file creation time as I had guessed...

ABFA is indeed reading the timestamp from the EXIF information in the CRW file.  However, the problem is that ABFA does not understand the CRW format, and is assuming the timestamp is at a fixed location in the file, which is a bad assumption since this location may easily change with different camera models, different firmware, or if the file is edited in any way (as you have discovered).

In my test 10D CRW file, the timestamp is originally at location 0x4d53c8, but after writing the OwnerName tag the location changes to 0x4d53e4.  I verified that the Canon FVU software reads the new file correctly including this timestamp.  However, ABFA attempts to read the timestamp from offset 0x4d53c8 in the new file and gets the wrong value.  (The 4 byes at this location happen to be "00 c0 00 00", which corresponds to the date "1970:01:01 00:51:12".)

This really should be considered a bug in ABFA, and should be reported to them.  ABFA should be accessing the date in the CRW file via the embedded CIFF directory structure rather than assuming a fixed location.  If their programmers need help understanding the CRW format, you can point them to the following document I have available:  https://exiftool.org/canon_raw.html

The good news is that you don't need ABFA to set the file time from the EXIF information because ExifTool will can do this for you:

Code:
   exiftool -tagsfromfile @ '-filemodifydate<datetimeoriginal' image.crw

Archive

[Originally posted by leprish on 2005-07-27 16:29:34-07]

Thank you for looking into this on my behalf and I will pass the info to the ABFA vendor crediting you with finding the reason for this problem. In the meantime what is the structure of the command line I need to use for applying the date fix to multiple files in a folder.

Sorry for being such a pain but Unix command line syntax is something I could never get my head round

Archive

[Originally posted by exiftool on 2005-07-27 17:06:41-07]

No problem at all.  The command line syntax can certainly be cryptic if you haven't had experience with it.

To fix the dates on all files in a directory, just replace the file name ("image.crw" in this example) with the directory name.  You can also add a "-r" option to also fix files in all subdirectories of this directory.

Through our interaction, I have realized a couple of improvements that I could make to ExifTool, and have implemented them in version 5.51 which is now available from my web site (click here to download).  This version speeds things up by not rewriting the file if you are just changing the timestamp, and allows a simplification of the command line syntax when redirecting information within a file by assuming "-TagsFromFile @" if not specified.

So with version 5.51 (or later), the following will also work:

Code:
   exiftool '-filemodifydate<datetimeoriginal' image.crw

    exiftool '-filemodifydate<datetimeoriginal' -r '/Users/phil/Pictures'

Archive

[Originally posted by leprish on 2005-07-27 19:18:45-07]

Thanks for the feedback regarding the format for the date. I found it very helpful especially since I could then use a similar approach to see what tags were available for my Canon CR2 format files. I used the "-S" option and find that owner name is available but trying to write the owner name into CR2 files returns the following error:

Possibly a Canon RAW file; may lose RAW data if rewritten - /Users/leprish/Pictures/ian/WU8J0054.CR2

Error: Error writing output file - /Users/leprish/Pictures/ian/WU8J0054.CR2

I used the following command line as my input:

~/Desktop/Image-ExifTool-5.51/exiftool -ownername='Leprish' -r'/Users/leprish/Pictures/ian'

This is the same format that I used for the CRW images and everything worked. Did something change from 5.48 to 5.51 that would cause CR2 files to produce the error?

BTW: I passed your info onto the ABFA vendor.

Archive

[Originally posted by exiftool on 2005-07-28 12:09:17-07]

This should be the same between 5.48 and 5.51.  In fact, this warning was introduced in 5.17 but is intended to be issued only for Canon 1D TIFF files (which can be RAW files in disguise), not CR2 files.  The warning can be ignored with the '-m' option, but I have put an additional check in the code to differentiate between these file types so the warning won't be issued for CR2 files because there should be no such problem when writing CR2.  Version 5.52 is now available with this update.

Thanks for pointing this out, and let me know if you have any other problems.

Archive

[Originally posted by leprish on 2005-07-28 16:13:53-07]

I downloaded version 5.52 and ran the same command line as yesterday and it worked perfectly.

I'm beginning to see that ExifTool is a very powerful and useful tool for making Exif edits to raw files. May be some day you'll have time to put an interface around it so that folk like me find it a lot easier to use.

Thanks again for your time and help, especially the very quick updates that resolved the issues I was having.

BTW: the date change that ABFA was seeing for CRW doesn't occur for CR2's so it looks like the ABFA code writer is on the right track with that format.

Archive

[Originally posted by exiftool on 2005-07-28 17:25:40-07]

I'm glad it's working well for you now.  Let me know if you have any more problems.

I'm a graphics programmer from way back, and have written many GUI-based programs on Mac, Windows, and Unix systems.  I've tried to imagine what sort of GUI I could write for ExifTool which would give you all the power of the command line version, and honestly I don't think it is possible without making the GUI incredibly complex which sort of defeats the purpose.  There are just so many things that ExifTool can do.  Other people have written drag-and-drop utilities for OS X based on ExifTool, which may be the way to go.  These provide a simple interface and only perform a simple function, but can be very convenient for commonly performed tasks.

I'm glad to hear you don't have problems with ABFA and the dates in CR2 files.  But if you did, I would be worried because CR2 files are based on the TIFF format, which is well documented (unlike CRW files which are based on the not-so-well-documented CIFF format).