ExifTool Forum

ExifTool => Newbies => Topic started by: lightproof on May 13, 2019, 02:27:06 PM

Title: Copy old Canon RAW metadata into EXIF
Post by: lightproof on May 13, 2019, 02:27:06 PM
Hi!

I have a bunch of old Canon CRW RAW files shot on EOS 300D. When I view them in Photo Mechanic or FastStone viewer I see no metadata, particularly no capture time and date. I checked the files with exiftool and there are no EXIF tags, only MakerNotes, which, I presume, are Canon RAW data. Is there a way to copy Canon data into EXIF fields? My primary goal is date and time, although ideally I would like having other data like lens, focal length, ISO, exposure etc. copied into EXIF as well.

So far I have tried to copy only the DateTimeOriginal value, and got the following results:

exiftool -v "-alldates<datetimeoriginal" — writes the time into XMP fields only. Both viewers still ignore it

exiftool -v "-EXIF:alldates<datetimeoriginal" — doesn't change the file at all, despite, apparently, attempting to write EXIF (it says Editing tags in ExifIFD IF0)

Is there anything I'm missing? Thanks.
Title: Re: Copy old Canon RAW metadata into EXIF
Post by: Phil Harvey on May 13, 2019, 03:15:31 PM
CRW files don't support EXIF metadata.  You can only add XMP to these files.

See the CRW entry in this table (https://exiftool.org/index.html#supported).

- Phil
Title: Re: Copy old Canon RAW metadata into EXIF
Post by: lightproof on May 20, 2019, 02:10:08 PM
Quote from: Phil Harvey on May 13, 2019, 03:15:31 PM
CRW files don't support EXIF metadata.  You can only add XMP to these files.


Thanks so much for the answer (and for exiftool)! That explains the behaviour.

What would be the proper way to copy all the Canon metadata to both internal XMP tags and external XMP sidecar file? Or at least to the sidecar file alone, so Photo Mechanic would (presumably) see it?
Title: Re: Copy old Canon RAW metadata into EXIF
Post by: Phil Harvey on May 20, 2019, 02:21:10 PM
I don't know what type of metadata PhotoMechanic can read from a CRW file.

- Phil
Title: Re: Copy old Canon RAW metadata into EXIF
Post by: lightproof on May 20, 2019, 03:44:33 PM
It can read only camera model (either that, or I'm doing something wrong). Apparently, Photo Mechanic reads THM sidecar files (of the CRW/THM pair) that contain EXIF metadata, but I have deleted all the THM files many years ago, before I learned about metadata. In my defence, all the software I used then read Canon's metadata just fine :)

That's why I'd like to copy Canon's metadata into XMP sidecar files, (which Photo Mechanic reads just fine), but I have no idea how to do it properly, or if exiftool can do it at all.
Title: Re: Copy old Canon RAW metadata into EXIF
Post by: StarGeek on May 20, 2019, 04:30:24 PM
You'll have to do some experimentation on your own but take a look at the examples under Metadata Sidecar Files (https://www.exiftool.org/metafiles.html).

For a file that doesn't already have a sidecar file, test with example #2 (https://www.exiftool.org/metafiles.html#EX2).  If it does already have a sidecar file, try example 1 (https://www.exiftool.org/metafiles.html#EX1).  That will copy all the obvious, same name tags from the CRW file to the side car.

I downloaded a sample CRW file from RawSamples.ch (http://www.rawsamples.ch/index.php/en/canon), used the first command, and this was the data in the resulting xmp file
---- XMP-x ----
XMPToolkit                      : Image::ExifTool 11.43
---- XMP-getty ----
OriginalFileName                : CRW_0003.CRW
---- XMP-aux ----
Lens                            : 17.0 - 50.0 mm
---- XMP-crs ----
ColorTemperature                : 5200
---- XMP-exif ----
ColorSpace                      : Adobe RGB
Contrast                        : Normal
DateTimeOriginal                : 2007:03:03 11:26:42
ExposureCompensation            : +1
ExposureTime                    : 1/35
FNumber                         : 2.8
FocalLength                     : 36.0 mm
ISO                             : 400
Saturation                      : Normal
Sharpness                       : Normal
UserComment                     :
---- XMP-exifEX ----
SerialNumber                    : 1230408320
OwnerName                       : Markus Schlieper
---- XMP-pmi ----
SequenceNumber                  : 0
---- XMP-tiff ----
ImageHeight                     : 2048
ImageWidth                      : 3072
Make                            : Canon
Model                           : Canon EOS 300D DIGITAL
Orientation                     : Horizontal (normal)


If that works for you, then you can proceed to example 11 (https://www.exiftool.org/metafiles.html#EX11) for files that don't already have a sidecar file and example 12 (https://www.exiftool.org/metafiles.html#EX12) for files that do already have a sidecar file.   Just replace EXT in both of those examples with CRW.

If you decide that you want to change the location of a tag, for example, in the above data you want OwnerName to be copied to XMP:Creator (a likely situation), then you would examine the full output of the CRW file using exiftool -g1 -a -s (from FAQ #3 (https://exiftool.org/faq.html#Q3)), select the tag name from the raw and use the -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) to copy the data.  For example,
exiftool -ext xmp -tagsfromfile %d%f.EXT "-XMP:Creator<OwnerName " -r DIR
Title: Re: Copy old Canon RAW metadata into EXIF
Post by: lightproof on May 28, 2019, 08:55:01 AM
Thanks, I'll give it a try!