ExifTool Forum

General => Metadata => Topic started by: peauproductions on September 25, 2018, 06:03:32 PM

Title: Pix4d FocalPlaneResolutionUnit Tag
Post by: peauproductions on September 25, 2018, 06:03:32 PM
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,
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: Phil Harvey on September 26, 2018, 09:01:48 AM
This is FAQ 6 (https://exiftool.org/faq.html#Q6).

- Phil
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: peauproductions on September 26, 2018, 12:44:46 PM
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,
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: peauproductions on September 26, 2018, 12:45:41 PM
Hi,

Here are the attached files I mentioned above.

Thank you.

Best,
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: StarGeek on September 26, 2018, 12:54:43 PM
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 (https://exiftool.org/exiftool_pod.html#n---printConv) 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
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: peauproductions on September 26, 2018, 01:18:22 PM
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,
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: Phil Harvey on September 26, 2018, 01:23:44 PM
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
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: StarGeek on September 26, 2018, 01:28:21 PM
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.
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: peauproductions on September 26, 2018, 02:25:39 PM
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,
Title: Re: Pix4d FocalPlaneResolutionUnit Tag
Post by: Phil Harvey on September 26, 2018, 03:51:19 PM
I that reading the details of the value conversions here (https://exiftool.org/under.html#conversions) may help to explain things.

- Phil