ExifTool Forum

ExifTool => Newbies => Topic started by: xeta on November 06, 2022, 01:56:54 AM

Title: Remove Decimal in XMP:Rating
Post by: xeta on November 06, 2022, 01:56:54 AM
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....

Title: Re: Remove Decimal in XMP:Rating
Post by: Phil Harvey on November 06, 2022, 07:36:53 AM
I'm not sure what "xamp" refers to, but this may do what you want:

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

- Phil
Title: Re: Remove Decimal in XMP:Rating
Post by: xeta on November 06, 2022, 08:26:56 AM
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
Title: Re: Remove Decimal in XMP:Rating
Post by: Phil Harvey on November 07, 2022, 11:58:42 AM
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