ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: koba on October 02, 2010, 08:43:03 AM

Title: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: koba on October 02, 2010, 08:43:03 AM
Hello,

It would be useful to be able to specify numerator and denominator for rational, instead of specifying floating number. For example, I would like to specify something like "-Gamma=22/10" instead of "-Gamma=2.2".

It seems that Canon Digital Photo Professional (DPP) identifies the TIFF file's color space as "AdobeRGB" only if there are tags ColorSpace, Gamma, WhitePoint, and PrimaryChromaticities with appropriate values, and the denominators for these rational values are predefined values (i.e. 10 for Gamma, 1000 for WhitePoint, 100 for PrimaryChromaticities). Current exiftool writes rational "11/5" for value "2.2", and it causes DPP to identifies the file's color space as "Other".

Thanks
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: Phil Harvey on October 02, 2010, 09:13:06 AM
Wow.  Can this be true that DPP is so stupid?  I'll look into this.

Adding control over the numerator/denominator would be a bit of work.

- Phil
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: koba on October 02, 2010, 10:17:20 AM
Hi Phil,

Thank you for your prompt reply. I used the 16-bit TIFF file generated by an old film scanner Dual III. DPP detects the TIFF file as "sRGB". By adding some tags as:

exiftool -overwrite_original -ColorSpace=Uncalibrated -Gamma=2.2 '-WhitePoint=0.313 0.329' '-PrimaryChromaticities=0.64 0.33 0.21 0.71 0.15 0.06' Image01.tif

DPP identifies it as "Other". I compared the file with the DPP-generated TIFF file, and found that rational for Gamma and some of
the values of PrimaryChromaticities are different. So I used a binary editor to modify these values, then DPP identified it as "AdobeRGB".

Regards,
koba
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: koba on October 02, 2010, 11:43:08 AM
Hi,

I could reproduce it with JPEG files. Unfortunately, it turned out that this is not only the problem of the name of color space. DPP-generated AdobeRGB JPEG file has Gamma value of "22/10" and is identified as "AdobeRGB". However, rewriting the Gamma value into "11/5" causes it to be identified as "Other", and the histogram to be changed. I tested with DPP version 3.8.1.0.

Regards,
koba
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: Phil Harvey on October 02, 2010, 11:47:25 AM
Hi Koba,

Thanks for the details.

I looked at my code and I think I may be able to implement your suggestion more easily than I thought.

- Phil
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: Phil Harvey on October 04, 2010, 07:47:17 AM
This is now implemented in ExifTool 8.33

- Phil
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: koba on October 04, 2010, 08:15:44 AM
Hi Phil,

Thank you! I confirmed that the file modified by following command is treated as "AdobeRGB" in DPP.

exiftool -overwrite_original -ColorSpace=Uncalibrated -Gamma=22/10 '-WhitePoint=313/1000 329/1000' '-PrimaryChromaticities=64/100 33/100 21/100 71/100 15/100 6/100' Image01.tif

Regards,
koba
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: Phil Harvey on October 04, 2010, 09:55:33 AM
Hi Koba,

Thanks for the confirmation.

This should really be considered a bug in the Canon DPP software.  It should not be sensitive to the individual components of a rational value since just the quotient is significant.

- Phil
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: koba on October 07, 2010, 08:06:06 AM
Hi Phil,

I agree with you from the technical point of view. To my surprise, however, the DCF 2.0 specification defines each components of rational values. Please see "5.4.4.4 Color space" in CP-3461A document for example. So it might be possible that Canon DPP just wanted to conform to the spec.

Regards,
koba
Title: Re: Feature Request: Specifying numerator and denominator explicitly for rational
Post by: Phil Harvey on October 07, 2010, 10:11:34 AM
Good point.

- Phil