Setting Rating from JSON file

Started by sebutzu, January 03, 2025, 01:43:46 PM

Previous topic - Next topic

sebutzu

calling exiftool with:
-fast -m -q -q -charset filename=UTF8 -d "%Y.%m.%d %H:%M:%S" -c "%.8f" -s -G:0:1 -a -all -use mwg -api largefilesupport=1 -overwrite_original -P -v3 -f -j="C:\Users\sebas\AppData\Local\Temp\tmpupmrcr.tmp"  "C:/Work/test photos/2022-03-05 12.16.14 0001.jpg"where the file contains:
[
  {
    "SourceFile": "C:/Work/test photos/2022-03-05 12.16.14 0001.jpg",
    "Composite:MWG:Rating": 4
  }
]

gives me:
Reading JSON file C:\Users\sebas\AppData\Local\Temp\tmpupmrcr.tmp
Imported entry for 'C:/Work/test photos/2022-03-05 12.16.14 0001.jpg' (full path: 'C:/Work/test photos/2022-03-05 12.16.14 0001.jpg')
======== C:/Work/test photos/2022-03-05 12.16.14 0001.jpg
Setting new values from JSON database
Including tags: all
Nothing changed in C:/Work/test photos/2022-03-05 12.16.14 0001.jpg

Please help, I do not know what am I doing wrong...
I would expect to set the value of rating...but it just gives me Nothing changed...

Phil Harvey

> exiftool a.jpg -composite:mwg:rating=1
Warning: Sorry, composite:mwg:Rating doesn't exist or isn't writable
Nothing to do.
> exiftool a.jpg -mwg:rating=1
    1 image files updated

I should probably look into why this doesn't work with the Composite group specified.

- 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 ($).

Phil Harvey

#2
Ah I see:

> exiftool -use mwg a.jpg -composite:mwg:rating=1
    1 image files updated

The MWG module isn't being loaded automatically when "Composite" comes first.  I should be able to fix this.

- Phil

Edit: I've patched this and ExifTool 13.12 will fix this issue.
...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 ($).

sebutzu


Phil Harvey

Right.  So this is a different problem.

Your command works when I remove -all.

(Something else that could be fixed)

- 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 ($).

sebutzu

Yes, removing all makes it work, thanks a lot!

Phil Harvey

I've looked into this...

The documentation doesn't state that wildcards and/or "all" may be used when specifying tags to import from a JSON file, but adding support for "all" is easy so I'll do that (even though it is completely unnecessary because this is the default).  But other wildcards still won't be supported.

- 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 ($).