Iterativ copiing form JPG TO RAW with same Filename / Fuji In Camera Star Rating

Started by timitalia, March 13, 2019, 12:01:46 PM

Previous topic - Next topic

timitalia

Just as mentioned during the end of this conversation, I also noticed that my Fuji XT-3 camera stores the "In Camera Rating" as MakerNote only in the JPEG file, not in the RAW file (recording mode RAW+JPEG).

The Field is:
[MakerNotes]    Rating                          : 3

So for the JPEG I get:
exiftool -Rating DSCF8825.JPG
Rating                          : 3


While for the RAW
exiftool -Rating DSCF8825.RAF
Rating                          : 0

(Because the Field does not exist in the RAW File)

So much for the introduction.

What I'm trying to write is a bash script which reads the field "[MakerNotes] Rating" for all JPEGs in a folder and copies this field including its value into the corresponding RAW file of the same name (e.g. DSCF8825.JPG,DSCF8825.RAF). Any Help for this script is much appriciated!

Background:
Fortunately, some programs such as Photo Mechanics can read and display the Fuji "In camera ratings" of the JPEGs. I would like to use the Bash Script with exiftool to avoid manually going over each RAW file and setting the same star rating as for the JPEG.


Cheers Tim

Phil Harvey

Hi Tim,

Try this (assuming your JPG files use an uppercase extension):

exiftool -tagsfromfile %d%f.JPG -fujifilm:rating -ext raf DIR

Or if you also want to add an XMP:Rating tag to be readable by other software:

exiftool -tagsfromfile %d%f.JPG -rating -ext raf DIR

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

timitalia

Hi Phil,

Thanks a lot! Not only for answering that fast but also giving me additional hints.
It basically works very well, but led me to further questions.

1)
The first one is just for my understanding:
When I run "exiftool -G DSCF8826.jpg" on an Image-File I rated "in-Camera" I can only see  one rating related field: 
[XMP]           Rating                          : 2
Nethertheless through you I learned that I can retrieve that value in two ways:

exiftool -Rating DSCF8826.jpg
Rating                          : 2
exiftool -Fujifilm:Rating DSCF8826.jpg
Rating                          : 2


Does it mean that the Fuji Camera stores the Rating at two different places? Or do these commands retrieve the value from the same field?

2)
The two commands you provide produce a copy of the original raw files like "DSCF8826.raf_original" (which is a wise feature I guess) but I don't need these copies and would like do get rid of them, is there a parameter?


3)
My desired workflow would be that I always ingest the photos from the sd card via Photo Mechanics first and then run the exiftool commands. But this way, the XMP Files produced by Photo Mechanics do not update their Rating Value, and therefore stars are not shown in the program. Is there a way that exiftool can update also this specific Photo Mechanic XMP File for each Photo(-Pair)?

XMP Example
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:photomechanic="http://ns.camerabits.com/photomechanic/1.0/"
    xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
   photoshop:DateCreated="2019-03-14T06:28:50"
   xmp:CreateDate="2019-03-14T06:28:50"
   xmp:Rating="0"
   photomechanic:ColorClass="0"
   photomechanic:Tagged="False"
   photomechanic:Prefs="0:0:0:008826"
   photomechanic:PMVersion="PM5"
   aux:ImageNumber="8826"/>
</rdf:RDF>
</x:xmpmeta>


- Tim

Phil Harvey

Hi Tim,

Quote from: timitalia on March 14, 2019, 02:38:06 AM
When I run "exiftool -G DSCF8826.jpg" on an Image-File I rated "in-Camera" I can only see  one rating related field: 

Use this command to see them all and where they come from (FAQ 3):

exiftool -a -G1 FILE

QuoteDoes it mean that the Fuji Camera stores the Rating at two different places?

Yes.

QuoteThe two commands you provide produce a copy of the original raw files like "DSCF8826.raf_original" (which is a wise feature I guess) but I don't need these copies and would like do get rid of them, is there a parameter?

You can add -overwrite_original to the command.

QuoteIs there a way that exiftool can update also this specific Photo Mechanic XMP File for each Photo(-Pair)?

Sure.  You can do the XMP at the same time you are updating the RAF files like this:

exiftool -tagsfromfile %d%f.JPG -rating -ext raf -ext xmp DIR

Note that here you must use -rating here (which will write the preferred XMP:Rating tag) because you can't write FujiFilm:Rating to an XMP file.

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

timitalia

Hi Phil,

thank you so much for your help and the mighty tool you wrote! Solved everything!

-Tim

hannesd

Hi all,

Just wanted to post this as it took me some time to figure out, maybe it can help others.

Using a Fuji X100F and just back from a longer trip where I was shooting RAW only.
The favorites/rating I selected in the camera during the trip unfortunatley were not imported automatically in Lightroom.

Using Lightroom Classic CC 8.1 and Fuji X100F and Exiftool 11.3.

1) In your Lichtroom Catalog select "Automatically Write Changes Into XMP"  > Exit Lightroom > Check Lightroom create all the XMP files next to the RAF files
See also  https://helpx.adobe.com/lightroom/help/metadata-basics-actions.html

2) Update rating in XMP files using exiftool command

I used this command (I'm new to exiftool so it might not be perfect)
exiftool -ext xmp -tagsfromfile %d%f.EXT -rating -r . (recursive search of current directory ".")

3) Open Lightroom again and right click on folder (eg. 2019) choose syncrhonize folder and "Scan for metadata updates", and the ratings were magically updated !! :)

Thanks for this great tool !! 

Regards, Hannes