Remove Decimal in XMP:Rating

Started by xeta, November 06, 2022, 01:56:54 AM

Previous topic - Next topic

xeta

I have used for Daminion for organizing my Photos, currently I am switching to Digikam.

Daminion saved the XMP:Rating with four decimals like
xamp:rating 4.0000Digikam does not read this format
It has to be fomartted to
xamp:rating 4
Can you help withe the command to remove the decimal

Thank you for this outstanding software exifttool. I am using it since years....


Phil Harvey

I'm not sure what "xamp" refers to, but this may do what you want:

exiftool "-rating<${rating;s/\..*//}" FILE

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

xeta

QuoteI'm not sure what "xamp" refers to, but this may do what you want:

Sorry for the typo, should mean:
xmp:rating
But you command does excactly what I needed. Thanks

Phil Harvey

Another way to do this would have been:

exiftool "-rating<${rating;$_ = int}" FILE

(taking the integer value of rating instead of stripping of the decimal using string manipulations)

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