Issue extracting Rating from Adobe converted DNG files from Sony A7RIII

Started by photo_JJ, September 01, 2019, 02:11:08 AM

Previous topic - Next topic

photo_JJ

First off, thank you for an amazing tool, and I apologize that my first post is a "issue"... hopefully I am just doing something wrong and this is easily fixed.

I have about 250k photos taken with a variety of cameras and I am trying to use ExifTool to generate a flat file list of all photos with key metadata so that I can import it into a database for analysis. After playing around a bit with a sample set of files, I have managed to generate tab delimited txt files with the fields I want, but I have a strange issue with Rating, specifically for one and only one camera - for Sony A7RIII files the Rating is showing up as "0".

I use Adobe Lightroom and convert all RAW files to DNG. I also have JPGs and HEIC files from cellphone cameras and older cameras. I save back metadata to files manually, but I have verified that the metadata has been saved to the files I am testing. The rating also shows up in Windows file properties, so I am pretty sure it is being saved properly.

The command line command I am using is:
exiftool -T -r  -Directory -FileName -FileType -FileSize -BitsPerSample -Make -Model -CameraSerialNumber -SerialNumber -Lens -ImageHeight -ImageWidth -HasCrop -CountryCode -Country -State -Province-State -City -Location -Sub-location -GPSAltitude -GPSDateStamp -GPSDateTime -GPSLatitude -GPSLatitudeRef -GPSLongitude -GPSLongitudeRef -GPSPosition -AmbientTemperature -CameraTemperature -CameraOrientation -Orientation -ImageStabilization -FocalLength -FocalLengthIn35mmFormat -FOV -CircleOfConfusion -DOF -HyperfocalDistance -ExposureProgram -ShootingMode -Aperture -ApertureValue -FNumber -MeteringMode -ExposureTime -ShutterSpeed -ShutterSpeedValue -WhiteBalance -ISO -AFAreaMode -AFAssistLamp -AFMode -AFPoint -AFTracking -AutoFocus -FocusMode -Flash -HierarchicalSubject -Keywords -Subject -Rating -Label -NumFacePositions -CreateDate -DateTimeOriginal -ProcessVersion -LightValue -Warning [directory] > out9.txt

(I'm still in the process of working out which fields I need, so some of those are "duplicates").

This works perfectly for a test set of photos from 15-20 different cameras, in both JPG and DNG format. But it doesn't work for Sony A7RIII DNGs, where the rating is "0".

I've also tried:

exiftool -csv -r [directory] > out2.csv

- to see if the Rating is being saved somewhere else, but I am fairly sure it isn't, or at least I couldn't find it anywhere.

I do get the Warning:

[minor] Bad IDC_IFD SubDirectory start

but I don't know what that means, or if it is relevant.....

There are some test files here if anyone wants to validate:

https://www.dropbox.com/sh/7a6h09t2ttjxph5/AAC9QLJfBEZttuahmbEUD4STa?dl=0

Any thoughts or suggestions?

Thank you in advance!!!

StarGeek

See FAQ #3.

If you run this command
exiftool -a -G1 -Rating 20190421-115155-SR302891.dng
You'll see that there is an XMP:Rating, which is the one that Windows reads, and Sony:Rating, which is probably at the default for when the picture was taken. 

Since you don't specify the exact group you want to read, I believe that exiftool with take the value of the last tag read.  And in this case, it appears to be the Sony tag.  Windows can only read the XMP tag and can't make heads or tails of proprietary MakerNotes where the Sony tag resides.

The easiest thing to do would be to use -XMP:Rating in your command.  Alternatively, you could look for files that have a discrepancy between the two tags and copy the XMP tag value into the Sony tag
exiftool -if "$Sony:Rating ne $XMP:Rating" "-Sony:Rating<XMP:Rating" <FileOrDir>

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

photo_JJ

Great, yes I can just use -XMP:Rating, and it works for all the files, including Sony.

I guess the Sony:rating is set to 0 and Lightroom is editing the XMP:Rating. Anyway, it works now for what I need, thank you very much!!

StarGeek

Quote from: photo_JJ on September 01, 2019, 04:18:54 AM
I guess the Sony:rating is set to 0 and Lightroom is editing the XMP:Rating. Anyway, it works now for what I need, thank you very much!!

Yep.  The Sony:Rating is part of the MakerNotes, which there are probably no publicly available documentation, subject to change without notice from Sony, and must be decoded by the photography community
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype