convert_regions.config issues with Orientation Rotate

Started by gwoods, June 05, 2019, 01:09:17 PM

Previous topic - Next topic

gwoods

I just found this tool yesterday so excuse me if I'm just missing a piece of the puzzle here... But when I run the tool with the config file, everything seems to convert perfectly with the exception of images containing the metadata:

Orientation   Rotate 270 CW
Camera Orientation   Rotate 270 CW

These files appear to have their regions reflected across the x and y axis. Anyone else run into this?

Phil Harvey

From the MWG documentation:

Rotation Issues
As discussed earlier in section 5.4, regarding Exif Orientation, if metadata is not updated upon a physical rotation of the image data some applications may incorrectly display the image. Region metadata is applied to the stored image. When applying a rotation by applying Exif Orientation, the rotation must be applied to the regions as well. Otherwise, the regions will not apply to the areas intended. If the stored image is rotated, the region metadata must also be updated to reflect the change.


So the region coordinates should be independent of the EXIF Orientation for the MWG RegionInfo metadata.

If this is different for the Microsoft regions, then we have a problem.

We also have a problem if the image was physically rotated after defining the MWG regions.

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

gwoods

Thank you for the quick response! Ill keep looking into it, I might be jumping the gun on what is causing the issue.
Would you happen to have a link to the MWG documentation? I see there are issues with http://www.metadataworkinggroup.org/ from googling around and form posts on this site.

Phil Harvey

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

gwoods

I'm still pretty stuck on this... So the coordinates of "Region Info" are strictly derived from the coordinates of "Region Info MP"?

If so, I guess I don't understand how Region Info MP is properly displayed in Photo Gallery, but the Region Info is in the wrong spot in Lightroom.

I probably just need to do more research on metadata in general...

Phil Harvey

If you can, try creating a Microsoft region in the upper-left hand corner two identical images, but one having Orientation "Horizontal", and one with "Rotate 270 CW".  Then take a look at the region coordinates.

I suppose it is possible that the coordinate system needs to be translated if the Orientation is not Horizontal, but I would be surprised because people have been using this config file for more than 6 years the way it is now.

- 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

A similar problem was encountered before.  From this post:

Microsoft lives in a fool's paradise: it completely ignores orientation.

So I guess I don't understand, because I though everything should be fine if the Orientation was ignored.

Oh well.

But the good news is that StarGeek provides a solution in the following post.  The command would be something like this:

exiftool -config Rotate_Regions.config -if "$Orientation eq 'Rotate 270 CW" "-RegionInfoMP<RotateMPRegionCW270" FILE

or maybe "-RegionInfoMP<RotateMPRegionCW90"

(I'm not sure which way you need to go.)

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

gwoods

I'll play around with it!
Thank you very much for you help, now I feel slightly better about sitting on this all morning  :-[

gwoods

Running the command, it says the conditional fails:

"1 files failed condition"

I'm not very good with syntax on the terminal (or command line if you will, I am on a windows machine) so I don't know if its a copy pasta problem.

But this should help verify the tag is there / the conditional should evaluate to true...

C:\Users\Grant\Desktop\PeopleTags\Changed>exiftool -Orientation D.jpg
Orientation                     : Rotate 270 CW

Phil Harvey

I can't explain why the -if is failing.  There must be something I can't see (hidden characters perhaps?)

At any rate, you can try it without the -if to see if the coordinates get rotated properly.

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

gwoods

Looks like 180 did the trick!

Appreciate your time.

Phil Harvey

180?  There was some mention of this in the other thread, but I can't understand this at all.

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