Page 1 of 1

BUG: unable to get ICC profile from jpg / Nikon RAW

Posted: 2011-01-22T17:13:06-07:00
by whatdoido
hi,

I'm using IM 6.6.7-1 on Fedora x64 (built from src). I am trying to programatically extract embedded ICC profiles from my jpgs / Nikon NEFs with the Magick++ i/f via

Code: Select all

Magick::Image::iccColorProfile(void)
However, for jpgs/nefs that contain ICC profiles, the IM tools do not believe there is any profile - the ICC profile is definitely there - the jpg was exported from Nikon's Capture NX with the correct option.

dcraw 9.05 and exiftool confirms the existance of the embedded profile

Code: Select all

$ dcraw -i -v test.jpg | grep -i profile
Embedded ICC profile: yes
$ exiftool -v test.jpg
...
  | 19) ICC_Profile (SubDirectory) -->
  | + [ICC_Profile directory with 9 entries]
  | | ProfileHeader (SubDirectory) -->
  | | + [BinaryData directory, 128 bytes]
  | | | ProfileCMMType = NKON
  | | | ProfileVersion = 544
  | | | ProfileClass = mntr
  | | | ColorSpaceData = RGB 
  | | | ProfileConnectionSpace = XYZ 
  | | | ProfileDateTime = 2009 2 20 17 7 10
  | | | ProfileFileSignature = acsp
  | | | PrimaryPlatform = APPL
  | | | CMMFlags = 0
  | | | DeviceManufacturer = none
  | | | DeviceModel = 
  | | | DeviceAttributes = 0 0
  | | | RenderingIntent = 0
  | | | ConnectionSpaceIlluminant = 0.9642 1 0.82491
  | | | ProfileCreator = 
  | | | ProfileID = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  | | 0)  ProfileDescription = Nikon sRGB 4.0.0.3002
  | | 1)  RedMatrixColumn = 0.43607 0.2225 0.01392
...
Using the IM i/f (Magick::Image::iccColorProfile(void) and ) Magick::Image::profile("...") with "ICC" and "ICM" as params) the Blob returned has zero size. identify reports no profile, and convert test.jpg test.icc fails

Code: Select all

]$ convert test.jpg test.icc
convert: no color profile is available `test.icc' @ error/meta.c/WriteMETAImage/2379.
The image that i've used is available below for your testing/validation of the bug.
https://sites.google.com/

Can you confirm that this is a bug or user error? thanks
Ray

Re: BUG: unable to get ICC profile from jpg / Nikon RAW

Posted: 2011-01-22T17:55:37-07:00
by magick
ImageMagick treats the EXIF profile as a blob. It does not extract the ICC profile from within the EXIF profile. We may add support for an embedded ICC profile within an EXIF profile in the future.

Re: BUG: unable to get ICC profile from jpg / Nikon RAW

Posted: 2011-01-23T01:53:58-07:00
by whatdoido
I think you misunderstood - I am reporting that for this given jpg / nef, IM is not able to give me the blob that is the icc profile. Ive read the docs that say that the icc will only presented as binary as is which is what I want but

Convert test.jpg test.icc

does not give me the binary icc blob for the example jpg. This cmd works on other jogs but not the example posted somthere is apparently something wrong

please verify and fix

Re: BUG: unable to get ICC profile from jpg / Nikon RAW

Posted: 2011-01-23T08:12:12-07:00
by magick
For your image, the ICC profile is embedded within the EXIF profile which is embedded in the JPEG. The ICC profile is not a separate profile. If it was, ImageMagick would recognize it. Currently ImageMagick does not extract ICC profiles embedded within an EXIF profile.

Re: BUG: unable to get ICC profile from jpg / Nikon RAW

Posted: 2011-01-24T07:23:26-07:00
by whatdoido
Thanks for the clarification.

Given that CNX2 has embedded the ICC in the Exif metadata, is there any (clean or otherwise) way to get at this ICC profile from the IM interfaces? If not, would you be able to point me at the correct code segment that I would possibly try to modify my local IM src so I could try to get at this data?

Re: BUG: unable to get ICC profile from jpg / Nikon RAW

Posted: 2011-01-24T07:25:35-07:00
by magick
We'll try to add support for embedded ICC profiles within an EXIF profile, but in the mean-time you can do that yourself. Look at magick/property.c/GetEXIFProperty().