RegionName and RegionArea fields mismatch

Started by stepan, March 22, 2017, 12:58:19 PM

Previous topic - Next topic

stepan

I wrote bash script to crop faces from JPG files exported from Adobe Lightroom.
Calculating of crops positions is OK, but I have problem to get right name because some regions can be unnamed and index of RegionArea is than not matching index in RegionName list.
I am simply calling exiftool img.jpg and then parsing fields by bash and grep.

#Region Area H                   : 0.06900, 0.07605, 0.06471, 0.07689, 0.07671, 0.07546
#Region Area W                   : 0.04701, 0.05099, 0.04225, 0.05082, 0.05411, 0.05125
#Region Area X                   : 0.29349, 0.41351, 0.45454, 0.39441, 0.18491, 0.72602
#Region Area Y                   : 0.29258, 0.55951, 0.28005, 0.29191, 0.24728, 0.24704
#Region Name                     : Alice, Bob, Charlie


Is there some way to get names right? For example to get full RegionName list with some values empty?
Or is it problem that data are not written right by Lightroom?

I can bypass this problem by deleting of unnamed faces first, but that would involve working on copy of data, ...

Phil Harvey

I'm afraid that you will have to add -struct to the command and parse the structures.

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

stepan

Yes, that is what I was missing.

Thanks a lot!