Kodak ProBack 645M copy TextualInfo Tags to exif tags

Started by Alex Matiash, August 01, 2017, 03:54:51 PM

Previous topic - Next topic

Alex Matiash

Hi. I faced problem that I can't find answer to. I have an old digital back, that writes some useful metadata in bad way - just as text:
QuoteLens: 45mm
Shutter: 1/1000
Aperture: f4.0
ISO Speed: 100
Exposure Mode: Aperture priority AE (Av)
Compensation: 0.0
White balance: Auto
Time: 07:05:59.975

I figured how to fill almost all necessary tags in the exif using command exiftool -overwrite_original -tagsfromfile %d%f.dcr -r -ext tif -exif:focallength<makernotes:focallength ., but the FocalLength tag is always 0. It is written to the TextualInfo Tags, but I can't understand how to ask exiftool to parse "Lens" tag and to fill FocalLength tag in the exif with this info.
Could you help me, please?

Stephen Marsh

My first thought would be to use a regular expression to only pull through the required value into the target tag... Can you share a copy of an image with the required metadata intact? The image only needs to be 1x1 pixel, it is all about the metadata.

Alex Matiash

Quote from: Stephen Marsh on August 02, 2017, 03:32:21 AM
My first thought would be to use a regular expression to only pull through the required value into the target tag... Can you share a copy of an image with the required metadata intact? The image only needs to be 1x1 pixel, it is all about the metadata.
I'm not sure I understand you correctly. I can share everything, but what image do you need - raw or tiff with metadata copied from raw?

Stephen Marsh

Whatever is easy for you and hopefully for me to download on a poor connection? A reduced size JPEG would be fine, it is all about the metadata – not the image format, so the smaller the file size the better as long as the metadata is intact.

Alex Matiash

Thank you! I'll upload file, but only tomorrow, unfortunately.

Stephen Marsh

#5
It will depend on how ExifTool displays the info, if it is in a single line string like this:

Lens: 45mmShutter: 1/1000Aperture: f4.0ISO Speed: 100Exposure Mode: Aperture priority AE (Av)Compensation: 0.0White balance: AutoTime: 07:05:59.975

Then the command would be similar to:

exiftool '-title<${XMP-xmpDM:LogComment;s/(Lens:\s)(\d+mm)(.*)/$2/}' 'DIRorFILE'


With the example above being copying the "45mm" text from -XMP-xmpDM:LogComment tag to the -title tag (use your own tags, these are just examples as I don't know which tags are the source and destination in your file).

___________

If ExifTool listed the info on separate lines, such as:

Lens: 45mm
Shutter: 1/1000
Aperture: f4.0
ISO Speed: 100
Exposure Mode: Aperture priority AE (Av)
Compensation: 0.0
White balance: Auto
Time: 07:05:59.975


Then the command could be:

exiftool '-title<${XMP-xmpDM:LogComment;s/(Lens:\s)(\d+mm)\n.*\n.*\n.*\n.*\n.*\n.*\n.*/$2/}' 'DIRorFILE'

This regex is a little ugly with the 7 new line meta characters, I am sure that there is a cleaner pattern, but that is the first thing that I came up with that worked.

Phil Harvey

Your command works to copy FocalLength with my sample DCR file here.  Post the output of exiftool -a -G1 -s on the DCR and I should be able to help more.

@Stephen: ExifTool parses the textual info to generate individual Kodak MakerNotes tags.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alex Matiash

Quote from: Phil Harvey on August 02, 2017, 07:18:38 AM
Your command works to copy FocalLength with my sample DCR file here.  Post the output of exiftool -a -G1 -s on the DCR and I should be able to help more.

There are too much to flood in the post, so I attached file.

Phil Harvey

Odd.  The FocalLength in IFD0 is 0.0mm, and there is not MakerNotes:FocalLength.

So you are stuck using MakerNotes:Lens as you thought:

exiftool -tagsfromfile %d%f.dcr "-focallength<makernotes:lens" -r -ext tif DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alex Matiash

It works! Thank you very much!
Just in case - is it possible to copy metadata from raw to tiff AND to do this trick with lens using one command, or it must be the separate pass after metadata copying?

P.S. Should be in separate post probably, but maybe I'm missing something obvious - CaptureOne does not open tiffs after metadata copying, shows error.

Phil Harvey

You can do it all in one command.  (and lots more if you want)

About the error:  You may have to narrow this down to figure out what metadata CaptureOne doesn't like.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alex Matiash

Quote from: Phil Harvey on August 02, 2017, 08:46:47 AM
You can do it all in one command.  (and lots more if you want)
Could you please explain how to do it? Command you proposed writes empty exif with the only field FocalLength set.

Phil Harvey

I don't know exactly what you want to do.  Something like this maybe?:

exiftool -tagsfromfile %d%f.dcr -all "-focallength<makernotes:lens" -r -ext tif DIR
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alex Matiash

Quote from: Phil Harvey on August 02, 2017, 10:17:05 AM
I don't know exactly what you want to do.  Something like this maybe?:

exiftool -tagsfromfile %d%f.dcr -all "-focallength<makernotes:lens" -r -ext tif DIR

Exactly! Thank you very much!

Alex Matiash

I was unable to determine what exactly prevents CaptureOne from displaying tiff with metadata copied from raw, so I ended with manually copying necessary tags ("-Make<Make" and so on).
Obviously it is not the most elegant way, because command line is very long. I was googling the way to solve my task before my first post here, and during googling (I believe) I saw mention of some way to ask ExifTool to load tags list (or something like that) from file, and use it in command line. I mean something like exiftool -tagsfromfile "tags.txt" .... Is it true, or I forgot\misunderstood what I read?

Also - near tiffs named as source raws I have pano tiffs with name like img_N-img_N+K.tif. Could you please tell me how to attach metadata from img_N.raw to this pano?

P.S. Is it possible to write metadata to the end of file instead of start? It would drastically speed up process in case of heavy files.