Page 1 of 1

Using -profile someprofile.icc fails

Posted: 2013-07-12T11:25:07-07:00
by RitzN
Hi there,

Our production machines are running version 6.8.5-5 and are working as intended. Our development machines are running builds 6.8.5-9 and 6.8.6-0 and there is now a problem with one of our scripts when using the -profile switch.

This is the script we are running given the .tif is an sRGB file:
# Embed the srgb.icm colorprofile
convert $2default.tif -intent perceptual -profile srgb.icm -colorspace srgb $2_pdf.tif

# Convert from sRGB to CMYK and change color profile from srgb.icm to swop2.icc
convert $2_pdf.tif -intent perceptual -profile srgb.icm -profile swop2.icc -colorspace cmyk $2_pdf.tif
Version 6.8.5-5, as mentioned, works fine with no errors at the point. However starting with at least built 6.8.5-9, this is the output:
convert.exe: UnableToTransformColorspace `001default.jpg' @ warning/profile.c/LCMSExceptionHandler/442., convert.exe: ColorspaceColorProfileMismatch `icc' @ error/profile.c/ProfileImage/642.
It looks like a change made sometime in May broke colorspace transformation... has there been a change (like the transistion from RGB to sRGB?)

Cheers,

Nathanael

Re: Using -profile someprofile.icc fails

Posted: 2013-07-12T12:20:09-07:00
by snibgo
But what is the command that is failing? Neither of those mention 001default.jpg.

The first command looks okay to me (although I'm not sure that intent is meaningful when you are just assigning a profile).

The second command shouldn't need the first "-profile" as the profile is already embedded. But that should be harmless.

Re: Using -profile someprofile.icc fails

Posted: 2013-07-12T12:22:16-07:00
by magick
Can you post a URL to your image, your profiles, and the exact commands you are using. We need to reproduce the problem, we tried on our system with ImageMagick 6.8.6-4, the latest release, and the conversion completed without complaint. We tried with both TIFF and JPEG images.

Re: Using -profile someprofile.icc fails

Posted: 2013-07-12T13:24:32-07:00
by RitzN
Hi there,

Thanks for the reply. Here are the files we are attempting to use.

https://s3.amazonaws.com/magickthis/scenic.jpg
https://s3.amazonaws.com/magickthis/srgb.icm
https://s3.amazonaws.com/magickthis/swop2.icc

This is the exact series of commands we are running from start to end (shell script with variables already substituted). It's a series of thumbnails we are creating. There is a version we create in CMYK for submission to a PDF contact sheet. Anyway...
convert scenic.jpg[0] -background white -flatten scenicdefault.tif
convert scenicdefault.tif -intent perceptual -profile srgb.icm -colorspace srgb scenicdefault.tif
cp scenicdefault.tif scenic_xl.tif
convert scenic_xl.tif -thumbnail 350x350 -profile srgb.icm scenic_xl.jpg
composite -gravity SouthWest -colorspace sRGB -compose atop scenic_xl.jpg 350White.png scenic_xlpad.jpg
composite -gravity NorthWest -colorspace sRGB -compose atop watermark.png scenic_xl.jpg scenic_xlw.jpg
convert scenic_xlpad.jpg -thumbnail 50x50 -density 72 -colorspace sRGB scenic_t.jpg
convert scenic_xlpad.jpg -thumbnail 100x100 -density 72 -colorspace sRGB scenic_s.jpg
convert scenic_xl.jpg -scale 208x177 -density 150 scenic_pdf.tif
convert scenic_pdf.tif -intent perceptual -profile srgb.icm -profile swop2.icc -colorspace cmyk scenic_pdf.tif
composite -gravity NorthWest -colorspace CMYK -compose atop scenic_pdf.tif 208x177White.jpg scenic_pdf.jpg
rm scenic_pdf.tif
rm scenicdefault.tif
rm scenic_xlpad.jpg
We can also try build 6.8.6-4, but I'm still including this for reference. Thanks.

Re: Using -profile someprofile.icc fails

Posted: 2013-07-12T13:46:53-07:00
by magick
Try 6.8.6-4. It works for us under Linux. If you find it fails under Windows, it could be a Windows specific problem and we'll investigate further.

Re: Using -profile someprofile.icc fails

Posted: 2013-07-12T15:37:10-07:00
by RitzN
Thanks. I'm currently testing ImageMagick on Mac OS 10.7 using Macports. Right now it only updates to 6.8.6-3.

Sorry for the mess I copy-pasted. I worked through our script and reduced down to the actual elements that leads to the creation of the CMYK tif from our sRGB scenic.jpg image. Can you go through these and confirm that the following error messages don't come about in 6.8.6-4?

Code: Select all

convert scenic.jpg scenicdefault.tif
convert: CompressionNotSupported `JPEG' @ error/tiff.c/WriteTIFFImage/2825.

Code: Select all

convert scenicdefault.tif -intent perceptual -profile srgb.icm -colorspace srgb scenicdefault.tif
cp scenicdefault.tif scenic_xl.tif
convert scenic_xl.tif -thumbnail 350x350 scenic_xl.jpg
convert scenic_xl.jpg -scale 208x177 -density 150 scenic_pdf.tif
convert: CompressionNotSupported `JPEG' @ error/tiff.c/WriteTIFFImage/2825.

Code: Select all

convert scenic_pdf.tif -intent perceptual -profile swop2.icc -colorspace cmyk scenic_pdf.tif
convert: UnableToTransformColorspace `scenic_pdf.tif' @ warning/profile.c/LCMSExceptionHandler/442.
convert: ColorspaceColorProfileMismatch `icc' @ error/profile.c/ProfileImage/642.
convert: UnableToTransformColorspace `scenic_pdf.tif' @ warning/profile.c/LCMSExceptionHandler/442.
convert: ColorspaceColorProfileMismatch `icc' @ error/profile.c/ProfileImage/642.
It actually does repeat like this after the last line. Again this is happening on ImageMagick 6.8.6-3 on Mac OS 10.7.5 from macports. Thanks for any further insight.

Re: Using -profile someprofile.icc fails

Posted: 2013-07-12T17:21:51-07:00
by magick
Your command sequence works without complaint with ImageMagick 6.8.6-4, the current release, under both Linux and Windows.