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?
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.
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?
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.
Thank you! I'll upload file, but only tomorrow, unfortunately.
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.
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
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.
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
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.
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
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.
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
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!
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.
Quote from: Alex Matiash on August 04, 2017, 07:51:23 AM
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?
You can put your command-line arguments in a txt file and use the
-@ option to use it:
exiftool -@ my_args.txt ...QuoteAlso - 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?
exiftool -tagsfromfile %d/%5f.raw -ext tif DIRQuoteP.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.
No, sorry. ExifTool always writes the metadata first.
- Phil
Quote from: Phil Harvey on August 04, 2017, 08:03:21 AM
You can put your command-line arguments in a txt file and use the -@ option to use it:
exiftool -@ my_args.txt ...
Probably I'm doing something wrong, because it tells me
Warning: Invalid tag name 'makernotes:lens" "-make<make" "-model<model" "-software<software" "-datetimeoriginal<datetimeoriginal" "-exposuretime<exposuretime" "-fnumber<fnumber" "-exposureprogram<exposureprogram" "-iso<iso" -artist="alex matiash" -copyright="alex matiash" ' - d:/photos/2017/2017-07-21/4G8X9640.tifin response to command
exiftool.exe -@ args.txt "d:\photos\2017\2017-07-21\4G8X9640.tif"I attached args.txt. It works when I use this string as command line arguments to the ExifTool, but does not when called via -@
Each arg needs to be on a separate line, see -@ docs (https://exiftool.org/exiftool_pod.html#ARGFILE). Also, you don't need quotes in an arg file. Try this
-overwrite_original
-tagsfromfile
%d%f.dcr
-focallength<makernotes:lens
-Make<Make
-Model<Model
-Software<Software
-DateTimeOriginal<DateTimeOriginal
-ExposureTime<ExposureTime
-FNumber<FNumber
-ExposureProgram<ExposureProgram
-ISO<ISO
-artist=Alex Matiash
-copyright=Alex Matiash
StarGeek, thank you very much!
Hi all, it's me again. And now I have the opposite problem: exifTool does not remove all metadata on "exiftool.exe -all= File". Actually:
C:\Program Files (x86)\Portable\ExifTool>exiftool.exe -all= 4H4J1127.tiff
Warning: [minor] Can't delete IFD0 from TIFF - 4H4J1127.tiff
1 image files updated
C:\Program Files (x86)\Portable\ExifTool>exiftool.exe -s 4H4J1127.tiff
ExifToolVersion : 10.60
FileName : 4H4J1127.tiff
Directory : .
FileSize : 95 MB
FileModifyDate : 2017:10:20 12:39:12+03:00
FileAccessDate : 2017:10:20 12:39:12+03:00
FileCreateDate : 2017:10:20 12:38:01+03:00
FilePermissions : rw-rw-rw-
FileType : TIFF
FileTypeExtension : tif
MIMEType : image/tiff
ExifByteOrder : Little-endian (Intel, II)
SubfileType : Full-resolution Image
ImageWidth : 4080
ImageHeight : 4080
BitsPerSample : 16 16 16
Compression : Uncompressed
PhotometricInterpretation : RGB
ImageDescription :
Make : Kodak
Model : ProBack645
StripOffsets : 364
Orientation : Unknown (9)
SamplesPerPixel : 3
RowsPerStrip : 4080
StripByteCounts : 99878400
MinSampleValue : 0
XResolution : 72
YResolution : 72
PlanarConfiguration : Chunky
ResolutionUnit : None
Software : 3.4.0.MH.ADF
ModifyDate : 2017:10:16 13:31:03
Artist :
Copyright :
ImageSize : 4080x4080
Megapixels : 16.6
C:\Program Files (x86)\Portable\ExifTool>
It is not a problem for me, but it is for the CaptureOne, which is unable to open tiffs with this data inside. As far as I understand - it gets stuck on tag "Make" and following.
Unfortunately, I was unable to ask google correctly enough, so could anybody help me, please?
Exiftool did remove all metadata. The info you are seeing is not metadata but file information. This you can't remove or otherwise there wouldn't be a file. Run exiftool -g0:1 -a on your file and it will show you where the info is coming from. Looks like the file not opening in CaptureOne is related to something else. How did you create that tiff file?
QuoteExiftool did remove all metadata.
I'm not sure, here is a screenshot of the beginning of this file:
(http://i.piccy.info/i9/4e77f878b441b9362014e0124435e46c/1508498910/6089/1123858/metadata.png)
All metadata listed by -s are visible.
QuoteRun exiftool -g0:1 -a on your file and it will show you where the info is coming from.
C:\Program Files (x86)\Portable\ExifTool>exiftool -g0:1 -a 4H4J1127.tiff
---- ExifTool ----
ExifTool Version Number : 10.60
---- File:System ----
File Name : 4H4J1127.tiff
Directory : .
File Size : 95 MB
File Modification Date/Time : 2017:10:20 12:39:12+03:00
File Access Date/Time : 2017:10:20 12:39:12+03:00
File Creation Date/Time : 2017:10:20 12:38:01+03:00
File Permissions : rw-rw-rw-
---- File ----
File Type : TIFF
File Type Extension : tif
MIME Type : image/tiff
Exif Byte Order : Little-endian (Intel, II)
---- EXIF:IFD0 ----
Subfile Type : Full-resolution Image
Image Width : 4080
Image Height : 4080
Bits Per Sample : 16 16 16
Compression : Uncompressed
Photometric Interpretation : RGB
Image Description :
Make : Kodak
Camera Model Name : ProBack645
Strip Offsets : 364
Orientation : Unknown (9)
Samples Per Pixel : 3
Rows Per Strip : 4080
Strip Byte Counts : 99878400
Min Sample Value : 0
X Resolution : 72
Y Resolution : 72
Planar Configuration : Chunky
Resolution Unit : None
Software : 3.4.0.MH.ADF
Modify Date : 2017:10:16 13:31:03
Artist :
Copyright :
---- Composite ----
Image Size : 4080x4080
Megapixels : 16.6
Looks like this data is written to place where it should not be.
QuoteLooks like the file not opening in CaptureOne is related to something else.
No, it is the cause. Because the same file before copying metadata, or after copying but then opened and saved in Photoshop, is opened by C1 as it should. Copying all metadata with exifTool, and removing it also with exifTool leaves file without exif, but with some orphaned non-image data.
QuoteHow did you create that tiff file?
By copying
all metadata from raw to tiff with exifTool. Keep in mind, that the raw is from really old camera, and the whole topic is about working around it's non-standardness.
See FAQ 7 (https://exiftool.org/faq.html#Q7) for deleting all metadata from a TIFF image.
- Phil
Thank you very much again, Phil!