Author Topic: convert_regions.config issues with Orientation Rotate  (Read 2302 times)

gwoods

  • Newbie
  • *
  • Posts: 6
convert_regions.config issues with Orientation Rotate
« on: June 05, 2019, 01:09:17 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18415
    • ExifTool Home Page
Re: convert_regions.config issues with Orientation Rotate
« Reply #1 on: June 05, 2019, 01:16:21 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwoods

  • Newbie
  • *
  • Posts: 6
Re: convert_regions.config issues with Orientation Rotate
« Reply #2 on: June 05, 2019, 01:41:30 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18415
    • ExifTool Home Page
Re: convert_regions.config issues with Orientation Rotate
« Reply #3 on: June 05, 2019, 01:47:34 PM »
Here you go
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwoods

  • Newbie
  • *
  • Posts: 6
Re: convert_regions.config issues with Orientation Rotate
« Reply #4 on: June 05, 2019, 02:59:42 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18415
    • ExifTool Home Page
Re: convert_regions.config issues with Orientation Rotate
« Reply #5 on: June 05, 2019, 03:12:24 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18415
    • ExifTool Home Page
Re: convert_regions.config issues with Orientation Rotate
« Reply #6 on: June 05, 2019, 03:23:19 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwoods

  • Newbie
  • *
  • Posts: 6
Re: convert_regions.config issues with Orientation Rotate
« Reply #7 on: June 05, 2019, 03:38:46 PM »
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

  • Newbie
  • *
  • Posts: 6
Re: convert_regions.config issues with Orientation Rotate
« Reply #8 on: June 05, 2019, 04:07:26 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18415
    • ExifTool Home Page
Re: convert_regions.config issues with Orientation Rotate
« Reply #9 on: June 05, 2019, 04:12:05 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwoods

  • Newbie
  • *
  • Posts: 6
Re: convert_regions.config issues with Orientation Rotate
« Reply #10 on: June 05, 2019, 04:38:52 PM »
Looks like 180 did the trick!

Appreciate your time.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18415
    • ExifTool Home Page
Re: convert_regions.config issues with Orientation Rotate
« Reply #11 on: June 05, 2019, 09:09:07 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).