Pix4d FocalPlaneResolutionUnit Tag

Started by peauproductions, September 25, 2018, 06:03:32 PM

Previous topic - Next topic

peauproductions

Hello,

I'm writing tags using ExifTools via Python subprocess. I can't seem to be able to load my metadata in Pix4D and I think the issue is the FocalPlaneResolutionUnit tag.


When tagging FocalPlaneResolutionUnit like this:   r'-FocalPlaneResolutionUnit=' + '4',

I get a warning:Warning: Can't convert ExifIFD:FocalPlaneResolutionUnit (not in PrintConv)

Why am I getting this warning?



When I tag FocalPlaneResolutionUnit like this:  r'-FocalPlaneResolutionUnit#=' + '4',

I do not get that warning and ExifTool writes FocalPlaneResolutionUnit as 'mm'.


Shouldn't the FocalPlaneResolutionUnit tag be '4' when I tag it like this: r'-FocalPlaneResolutionUnit#=' + '4' (with #)

and 'mm' when tagged like this:  r'-FocalPlaneResolutionUnit=' + '4' (without #)?



The reason why I ask is because the Pix4d documentation says that it expects a 2,3, or 4. However, when writing tags it appears that ExifTools is doing that conversion itself. And from what I thought, the # was suppose to write the raw value, but it seems like the # is actually doing the conversion rather than writing the raw value of 4 which I think is necessary for Pix4D to load my metadata correctly.

Pix4D documentation:
"Unit for Exif.Photo.FocalPlane[XY]Resolution:
2 = inch
3 = cm
4 = mm"

I have attached my config file. Pix4D seems to not be loading any of my metadata and I think the issue comes from this tag. If you could please let me know why this is occurring that would be great. Thank you so much!

Best,

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

peauproductions

Hi,

It seems like FAQ6 is not necessarily answer the question I am asking. My issue is that adding the # to disable the print conversion is not working.

I am tagging FocalPlaneResolutionUnit in Python like this: r'-FocalPlaneResolutionUnit#=' + '4'

Additionally, I am tagging GPSAltitudeRef and ExposureMode like this: r'-GPSAltitudeRef#=' + '0', r'-ExposureMode#=' + '1'


When using the "#" symbol in  r'-FocalPlaneResolutionUnit#=' + '4', the FocalPlaneResolutionUnit tag should be written as a '4' correct? When I tag it like this r'-FocalPlaneResolutionUnit#=' + '4', it is writing 'mm', which I do not want because I added the '#' to get the raw values. As I mentioned before, Pix4D expects raw values and since I can't seem to disable the print conversion, I am unable to load the images into Pix4D.

Could it be that there is something wrong in my config file?

Attached is a screenshot of the metadata in exiftool(-k).exe and the config file. I am using version 10.8.2.0 version of exiftool.exe.

Thank you for your help.

Best,

peauproductions

Hi,

Here are the attached files I mentioned above.

Thank you.

Best,

StarGeek

Quote from: peauproductions on September 26, 2018, 12:44:46 PM
It seems like FAQ6 is not necessarily answer the question I am asking. My issue is that adding the # to disable the print conversion is not working.

The first line in FAQ 6
"By default, ExifTool applies a print conversion (PrintConv) to extracted information to make the output more human-readable."

Exiftool is converting 4 to mm to make it more readable.  It doesn't write it as "mm", it writes it as 4.  If you want to see the raw numbers on output, you have to use the -n option or the hashtag equivalent.

Here's output example where I first write the raw value of 4, then write "mm", which exiftool automatically converts to 4.
C:\>exiftool -P -overwrite_original -FocalPlaneResolutionUnit#=4 y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -FocalPlaneResolutionUnit -FocalPlaneResolutionUnit#  y:\!temp\Test4.jpg
---- ExifIFD ----
FocalPlaneResolutionUnit        : mm
FocalPlaneResolutionUnit        : 4

C:\>exiftool -P -overwrite_original -FocalPlaneResolutionUnit=mm y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -FocalPlaneResolutionUnit -FocalPlaneResolutionUnit#  y:\!temp\Test4.jpg
---- ExifIFD ----
FocalPlaneResolutionUnit        : mm
FocalPlaneResolutionUnit        : 4
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

peauproductions

Hi,

Thanks StarGeek for the quick response!

QuoteIf you want to see the raw numbers on output, you have to use the -n option or the hashtag equivalent.

Since I am using the hashtag, shouldn't I be expecting the raw number on output? Here is how I am tagging: r'-FocalPlaneResolutionUnit#=' + '4'

So when using exiftool(-k).exe to output the metadata, sinced I used the hashtag, the value should be 4 right?


Or is it that the FocalPlaneResolutionUnit is being written as a 4 but when using exiftool(-k).exe, the value gets outputted as 'mm' because  exiftool(-k).exe applies a print conversion? Just for clarification, I am tagging the images and then dragging the images into exiftool(-k).exe.

Thanks for the help!

Best,

Best,

Phil Harvey

Quote from: peauproductions on September 26, 2018, 01:18:22 PM
So when using exiftool(-k).exe to output the metadata, sinced I used the hashtag, the value should be 4 right?

No.  You should only see "4" if you use the -n option or -focalplaneresolutionunit# when READING, not when writing.

QuoteOr is it that the FocalPlaneResolutionUnit is being written as a 4 but when using exiftool(-k).exe, the value gets outputted as 'mm' because  exiftool(-k).exe applies a print conversion?

Yes.

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

StarGeek

If you want to see the raw numbers by drag&drop, you can rename exiftool(-k).exe to exiftool(-k -n).exe  But you need to be aware that this would give you raw numbers on all the output.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

peauproductions

Hi,

Thank you StarGeek and Phil for all the help. I have started using the Command-line ExifTool to read the metadata to avoid confusion.

I'm tagging FocalPlaneXResolution and FocalPlaneYResolution like this: r'-FocalPlaneXResolution#=' + '614/100',

The reason I am tagging like that is because Pix4D requires the value to be rational.

This is how I am writing my config file for that tag: FocalPlaneXResolution   => { Writable => 'rational64u'},


As you can see in the code below, regardless of when I use the hashtag symbol or not, I still am reading a value of 6.14 instead of the rational value of "614/100".

C:\Users\ethan\Desktop>exiftool -FocalPlaneXResolution# C:\Users\ethan\Desktop\Morales\Testing\Research\0924_exif\Processed_21\P14B01223.tif
Focal Plane X Resolution        : 6.14

C:\Users\ethan\Desktop>exiftool -FocalPlaneXResolution C:\Users\ethan\Desktop\Morales\Testing\Research\0924_exif\Processed_21\P14B01223.tif
Focal Plane X Resolution        : 6.14


How can I write a rational value?

Best,

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