identify: no pixels defined in cache `XXXXX' @ c

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
Moonshine

identify: no pixels defined in cache `XXXXX' @ c

Post by Moonshine »

I use "identify" to check the colorspace of images on upload. Previously it had been working flawlessly, however a recent Fedora 11 update seems to have identify tossing random errors on some CMYK files being uploaded. I'm using:

Code: Select all

Version: ImageMagick 6.5.1-2 2010-01-06 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
The command I use:

Code: Select all

/usr/bin/identify -quiet -format '%[colorspace]' cmyk_test_image.jpg
Results in:

Code: Select all

identify: no pixels defined in cache `cmyk_test_image.jpg' @ cache.c/OpenPixelCache/3789.
CMYK
Here is an image for testing:

http://james.netfocal.com/test/cmyk_test_image.jpg

BTW, it also looks like the copyright could use an update to 2010 :)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by magick »

Your command works fine with the latest releases of ImageMagick. We're not sure why it fails for ImageMagick 6.5.1. We'll investigate.
Moonshine

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by Moonshine »

Thanks for the reply.. I'll compile my own, but I would be curious what version made the correction if you happen to find out. Just so I can jump back on the Yum train again someday for these servers. :)
Moonshine

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by Moonshine »

I updated a development machine here to 6.6 via the binary distribution today. Identify does work without error for me in 6.6. Excellent. :)

However my "convert" script (for converting the images from CMYK to RGB) seems to have very different output from 6.5.1-2 to 6.6 using the same command and profile. The output I get from 6.6 looks very washed out, like a levels or gamma shift, and the color mapping seems different also. The ouput from 6.5.1-2 is correct when compared to Photoshop CS4 and OSX preview output. An example command is like:

Code: Select all

convert test-cmyk.jpg -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' -profile sRGB.icc test-rgb.jpg
using the files here:

http://james.netfocal.com/imagemagick

which produces this in 6.5.1-2:

Image

and this in 6.6:

Image

I've tried poking around to see if there are some new options I should use, or if a new profile would help, but I can't seem to find anything to correct things. Not sure if anyone has suggestions, or if I should just open a new thread...

Thanks for any help... :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by fmw42 »

try

convert -colorspace RGB test-cmyk.jpg -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' -profile sRGB.icc test-rgb.jpg

or just

convert -colorspace RGB test-cmyk.jpg -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' test-rgb.jpg

The latter seems to work for me. I could not do the former as I don't have that profile handy.

IM 6.6.0-0 Q16 Mac OSX Tiger

If you have a CMYK profile, then you can use that before your sRGB profile and avoid using -colorspace RGB

see http://www.imagemagick.org/Usage/formats/#profiles
Moonshine

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by Moonshine »

Thanks for the reply! I'm testing with 6.6.0-0 Q16 under Fedora core 11.

With your first suggestion I got:

Code: Select all

[root@lightning imagemagick]# convert -colorspace RGB test-cmyk.jpg -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' -profile sRGB.icc test-rgb.jpg
convert: color profile operates on another colorspace `icc' @ error/profile.c/ProfileImage/1090.
However it did produce an image that is "closer" to correct:

Image

The second suggestions produced no error and it looks to have the same output:

Image

Levels are looking much better :) but the color shift is still there.

I actually was using a CYMK profile in addition to the final sRGB profile until I started researching things earlier. That link you gave stated:
WARNING:
If the original image already contains a profile, for example a CMYK profile, then given two profile conversions is a bad idea.
As my sample has a CMYK profile already embedded, I pulled it. Do my examples above match what you see?

Thanks again..
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by fmw42 »

yes my result also show a pink face. but the cmyk profile should not be pulled out even if in the image, if IM cannot read or recognize that it is there (as I understood that page). what happens when you put it back in and remove the -colorspace RGB?

(Note, I am no expert on -profiles)
Moonshine

Re: identify: no pixels defined in cache `XXXXX' @ c

Post by Moonshine »

Adding the CMYK profile back in there at the beginning seemed to give me the same output as if it wasn't included. At least with this image, which has a CMYK SWOP profile embedded. Basically:

Code: Select all

convert -profile USWebCoatedSWOP.icc  test-cmyk.jpg -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' -profile sRGB.icc test-rgb.jpg
Results in:

Image

BUT...... :D I kept fiddling with things and it appears that the order of the profile arguments with respect to other arguments is now important in 6.6:

Code: Select all

convert test-cmyk.jpg -profile USWebCoatedSWOP.icc -profile sRGB.icc -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' test-rgb.jpg
Results in:

Image

While tossing them in at the end:

Code: Select all

convert test-cmyk.jpg -resize 600x600! -unsharp 0.5x0.4+0.8+0.1 -quality '80' -profile USWebCoatedSWOP.icc -profile sRGB.icc test-rgb.jpg
Gives the poor output I was seeing.

I imagine this will trip some other people up also, but at least now I can go to happy hour... happy. :)
Post Reply