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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
whatdoido
Posts: 27
Joined: 2011-01-22T16:54:46-07:00
Authentication code: 8675308

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

Post 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
Last edited by whatdoido on 2011-02-08T16:16:48-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
whatdoido
Posts: 27
Joined: 2011-01-22T16:54:46-07:00
Authentication code: 8675308

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
whatdoido
Posts: 27
Joined: 2011-01-22T16:54:46-07:00
Authentication code: 8675308

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

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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().
Post Reply