Hi All.
I would like to bulk change the "GPS Img Direction" by 180 degrees on a lot on panoramic images.
The values are already populated (just faceing the wrong direction)
is there and easy exiftool command line (linux) to spin these images by 180 degrees (avoiding numbers less then 0 and more then 360)??
thanks
Matt :)
Hi Matt,
Are the directions integral or do they have decimal values?
If integer, this will work:
exiftool '-gpsimgdirection<${gpsimgdirection;$_=($_+180)%360}' FILE
where FILE is one or more file and/or directory names.
But if the values are decimal, we can't use the integer modulus operator, and the expression would be more complicated.
- Phil
Thanks Phil
Unfortunately they are decimal values.
Is it possible/easy to round it to an integer? (rounding is perfectly fine - the resolution of the capture is not that high anyway)
thanks
Matt :)
Hi Matt,
The above solution will truncate the decimal part.
To preserve the decimal part, you could do this:
exiftool '-gpsimgdirection<${gpsimgdirection;use POSIX;$_=POSIX::fmod($_+180,360)}' FILE
- Phil
Edit: Note that you must have an exiftool version less than a year old (9.30 or later), to use this advanced formatting feature.
wonderful -- thanks phil