Convert facetags from WLPG to Picasa

Started by raldo, August 27, 2012, 05:53:31 PM

Previous topic - Next topic

EFortune

Indeed, taking a closer look at the "lr" metadata I notice that Lightroom added "Region Rotation -1.57080", which looks suspiciously like 180 degree rotation.  X & Y appear to also be transformed, though.

This image is rotated 90 CW.  If this theory is correct than images rotated the other way would presumably look right.  I rarely shoot that way and don't have any such images in my lightroom test folder, but I'm about to go shooting and I'll make a point of getting some portrait images in both directions so I have something to compare directly.

Cheers,
     Erik

StarGeek

As I recall it, the Microsoft region specs don't take orientation into account.

I created a config file that will allow you to rotate regions.  You can grab it from this post.   Your command would be something along the lines of:
exiftool -config Rotate_Regions.config -if "$Orientation eq 'Rotate 180 CW'" -RegionInfoMP<RotateMPRegionCW180" FILEorDIR


* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

EFortune

I went and hacked the convert_regions config to rotate the regions 180 degrees for any image with orientation 90 CW or 270 CW (attached).  It's fairly ugly but it seems to be reliably pushing face tags in both directions, which is good enough for me, for now.

Thanks for all of your help!

milchtaich

Quote from: EFortune on October 03, 2015, 01:09:04 PM
Indeed, taking a closer look at the "lr" metadata I notice that Lightroom added "Region Rotation -1.57080", which looks suspiciously like 180 degree rotation.  X & Y appear to also be transformed, though.

This may have to do with the problem I described (https://exiftool.org/forum/index.php/topic,6354.msg32157.html#msg32157) with Microsoft's mis-implementation of their own standard. Specifically, they seem to write the x and y coordinates in the wrong order with respect to the published standard, and similarly for H and W.

By the way, 1.57 radians is 90°, not 180°. Lightroom's Region attribute describes the rotation of the face relative to the unrotated image. When the application reads the face information rather than identifying it itself, the value of the attribute simply reflects the Exif orientation tag. So this number doesn't have much to do with the problem you identified.

EFortune

You're right of course.  I should know better than to attempt a coherent post at 3 in the morning:)

For whatever reason, it appears that all of the images identified as portrait (either 90 or 270) had regions that were 180 degrees out of phase.  Rotating the regions in just those images seems to have worked for the 20k or so images I've tried so far.

Leonardozep

WOW, I tried to convert the tags from Picasa to Windows Live Photo Gallery and... it works!!! Thank you very much! I will be always grateful to you for this jewel!

Leonardozep

PS: is there a way to "batch convert" the regions? As I have 1.476 folders it would be great to do something like Pictures folder\*.jpg . I've tried but the *.jpg work only inside the folder and not through subfolders. Thanks anyway, this program and this script is really a JEWEL!

StarGeek

Use the -ext option instead of *.jpg, add -r to recurse into subfolders.  -ext jpg -r path/to/TopLevelFolder
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Leonardozep

Quote from: StarGeek on February 16, 2016, 05:58:31 PM
Use the -ext option instead of *.jpg, add -r to recurse into subfolders.  -ext jpg -r path/to/TopLevelFolder

Thanks! Will try!

Leonardozep


andorp

Hello,

I really appreciate your work. I can see that you helped to a lot of people. Last week moved from windows to mac and from Photo Gallery to  Lightroom and observed that face tags were not imported.

I came across your tool when I was looking for a solution for my problem:Today I tried the following command on a test-folder, which I knew to contain face tags:

exiftool -config ExifTool_config_convert_regions "-regioninfo<myregion" /Users/myname/Downloads/2013_12_01 -m -r -overwrite_original

Unfortunately, this is the result I have got:

"Config file not found
Warning: No writable tags set from /Users/Pivarcsi/Downloads/2013_12_01/_DSC3456.JPG
...
1 directories scanned
    0 image files updated
   72 image files unchanged"

I am not an expert and I do not know whether this could be the problem, but a user with  a similar problem has been suggested (by ryerman) to specify the full path for the config file and Phil was kind enough to specify it to the user who asked about this (c:\ExifToolGUI\exiftool.exe -config c:\ExifToolGUI\ExifTool_config_convert_regions), which solved the problem.

I am sorry but I do not know what the equivalent solution for mac OS is.

Thank you for your help in advance.

Phil Harvey

Instead of typing "ExifTool_config_convert_regions", drag and drop that config file on the cmd.exe window.  This will automatically enter the full path for you so that exiftool can find it.

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

andorp

Worked wonderfully. Thank you! Your tool is fantastic!

I have tagged all of my photos carefully and feared that I did it in vain.

I have received a few error messages, about which I don't know whether I should worry about (see below). Probably not so much, since the face tags were where they were supposed to be after importing the test-photos into Lightroom. And this is what counts for me most.

Use of uninitialized value in transliteration (tr///) at /usr/local/bin/lib/Image/ExifTool/WriteXMP.pl line 170.
Use of uninitialized value in scalar assignment at /usr/local/bin/lib/Image/ExifTool/XMP.pm line 2566.
Use of uninitialized value in pattern match (m//) at /usr/local/bin/lib/Image/ExifTool/XMP.pm line 2568.
Use of uninitialized value $str in substitution (s///) at /usr/local/bin/lib/Image/ExifTool/XMP.pm line 2450, <EXIFTOOL_FILE2> chunk 16.
Use of uninitialized value in addition (+) at /usr/local/bin/lib/Image/ExifTool/WriteXMP.pl line 1159, <EXIFTOOL_FILE2> chunk 16.
Use of uninitialized value $val in string eq at /usr/local/bin/lib/Image/ExifTool/WriteXMP.pl line 1269, <EXIFTOOL_FILE2> chunk 16.

Phil Harvey

Can you possibly send me a sample image which gave these warnings?  I would like to track this down.  My email is philharvey66 at gmail.com

Thanks

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

andorp

An invitation has been sent to your e-mail via dropbox.