Excess ICC profiles generated during extraction from PSD/PSB

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
electricart
Posts: 14
Joined: 2013-07-23T17:53:31-07:00
Authentication code: 6789

Excess ICC profiles generated during extraction from PSD/PSB

Post by electricart »

Hi all,

I've run into a possible bug where when extracting the ICC profile from a file. I've emailed the details through to the Imagemagick developers at http://www.imagemagick.org/script/contact.php however I wanted to post here to see if anyone else had experienced this, and/or knows at which version this issue might have started, so I can revert to an earlier working version - or indeed to see if I'm doing something wrong.

Issue: When extracting an ICC profile from a large PSD or PSB file (I've tested two files - 1.07GB PSD and 1.31GB PSB), 42 ICC profile files are extracted instead of just one. Smaller PSD/PSB files (74MB) are unaffected. Though possibly this is a layer issue? Perhaps Imagemagick is extracting an ICC for each layer? I don't believe it should do this though as there is only one ICC for the file...

Imagemagick usage;

Code: Select all

$ convert -verbose PSD_RGB_Test.psd icc:PSD_RGB_Test.icc
PSD_RGB_Test.psd[0] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 1.0731GB 49.780u 1:18.019
PSD_RGB_Test.psd[0] PSD 5412x7369 5412x7369+0-89 8-bit DirectClass 1.0731GB 47.890u 1:16.150
PSD_RGB_Test.psd[0] PSD 5288x7029 5288x7029+83+20 8-bit DirectClass 1.0731GB 47.890u 1:16.150
PSD_RGB_Test.psd[0] PSD 622x321 622x321+2304+1095 8-bit DirectClass 1.0731GB 47.890u 1:16.150
PSD_RGB_Test.psd[0] PSD 201x2176 201x2176+2463+1123 8-bit DirectClass 1.0731GB 47.890u 1:16.150
PSD_RGB_Test.psd[0] PSD 131x95 131x95+2463+1231 8-bit DirectClass 1.0731GB 47.890u 1:16.160
PSD_RGB_Test.psd[0] PSD 5412x7370 5412x7370+0+289 8-bit DirectClass 1.0731GB 47.890u 1:16.160
PSD_RGB_Test.psd[0] PSD 5608x7685 5608x7685-169+0 8-bit DirectClass 1.0731GB 47.890u 1:16.160
PSD_RGB_Test.psd[0] PSD 5444x7370 5444x7370+36-107 8-bit DirectClass 1.0731GB 47.890u 1:16.160
PSD_RGB_Test.psd[0] PSD 488x3169 488x3169+2328+913 8-bit DirectClass 1.0731GB 47.890u 1:16.160
PSD_RGB_Test.psd[0] PSD 2202x3684 2202x3684+1431+486 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 269x394 269x394+2316+1334 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 2202x3684 2202x3684+1438+527 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 92x96 92x96+2474+1097 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 797x3336 797x3336+2221+855 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 584x311 584x311+2334+1222 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 5412x7216 5412x7216-33-633 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 3307x2408 3307x2408+2064+3714 8-bit DirectClass 1.0731GB 47.880u 1:16.149
PSD_RGB_Test.psd[0] PSD 240x209 240x209+2116+3683 8-bit DirectClass 1.0731GB 47.870u 1:16.140
PSD_RGB_Test.psd[0] PSD 181x198 181x198+1962+3840 8-bit DirectClass 1.0731GB 47.870u 1:16.140
PSD_RGB_Test.psd[0] PSD 196x187 196x187+1979+4115 8-bit DirectClass 1.0731GB 47.870u 1:16.140
PSD_RGB_Test.psd[0] PSD 207x160 207x160+2172+4408 8-bit DirectClass 1.0731GB 47.870u 1:16.140
PSD_RGB_Test.psd[0] PSD 5445x7849 5445x7849-33-633 8-bit DirectClass 1.0731GB 47.870u 1:16.140
PSD_RGB_Test.psd[0] PSD 5614x7546 5614x7546-202-330 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 5614x7849 5614x7849-202-633 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 5655x7849 5655x7849-243-633 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 5658x8109 5658x8109-246-893 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 5658x8109 5658x8109-246-893 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 1472x2712 1472x2712+1828+626 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 1472x2712 1472x2712+1828+626 8-bit DirectClass 1.0731GB 47.860u 1:16.129
PSD_RGB_Test.psd[0] PSD 4709x6299 4709x6299+404-758 8-bit DirectClass 1.0731GB 47.850u 1:16.129
PSD_RGB_Test.psd[0] PSD 135x304 135x304+2503+2082 8-bit DirectClass 1.0731GB 47.850u 1:16.129
PSD_RGB_Test.psd[0] PSD 158x1028 158x1028+2532+1753 8-bit DirectClass 1.0731GB 47.850u 1:16.129
PSD_RGB_Test.psd[0] PSD 208x323 208x323+2494+2022 8-bit DirectClass 1.0731GB 47.850u 1:16.129
PSD_RGB_Test.psd[0] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 1.0731GB 47.850u 1:16.120
PSD_RGB_Test.psd[0] PSD 103x24 103x24+2563+1795 8-bit DirectClass 1.0731GB 47.850u 1:16.120
PSD_RGB_Test.psd[0] PSD 99x707 99x707+2562+1799 8-bit DirectClass 1.0731GB 47.850u 1:16.120
PSD_RGB_Test.psd[0] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 1.0731GB 47.850u 1:16.120
PSD_RGB_Test.psd[0] PSD 173x1030 173x1030+2521+1782 8-bit DirectClass 1.0731GB 47.850u 1:16.120
PSD_RGB_Test.psd[0] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 1.0731GB 47.850u 1:16.120
PSD_RGB_Test.psd[0] PSD 5667x7440 5667x7440-159-221 8-bit DirectClass 1.0731GB 47.850u 1:16.130
PSD_RGB_Test.psd[0] PSD 5416x7216 5416x7216-4+0 8-bit DirectClass 1.0731GB 47.850u 1:16.130
PSD_RGB_Test.psd=>PSD_RGB_Test-0.icc[0] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 0.010u 0:00.129
PSD_RGB_Test.psd=>PSD_RGB_Test-1.icc[1] PSD 5412x7369 5412x7369+0-89 8-bit DirectClass 0.010u 0:00.109
PSD_RGB_Test.psd=>PSD_RGB_Test-2.icc[2] PSD 5288x7029 5288x7029+83+20 8-bit DirectClass 0.010u 0:00.119
PSD_RGB_Test.psd=>PSD_RGB_Test-3.icc[3] PSD 622x321 622x321+2304+1095 8-bit DirectClass 0.010u 0:00.129
PSD_RGB_Test.psd=>PSD_RGB_Test-4.icc[4] PSD 201x2176 201x2176+2463+1123 8-bit DirectClass 0.010u 0:00.139
PSD_RGB_Test.psd=>PSD_RGB_Test-5.icc[5] PSD 131x95 131x95+2463+1231 8-bit DirectClass 0.010u 0:00.129
PSD_RGB_Test.psd=>PSD_RGB_Test-6.icc[6] PSD 5412x7370 5412x7370+0+289 8-bit DirectClass 0.010u 0:00.140
PSD_RGB_Test.psd=>PSD_RGB_Test-7.icc[7] PSD 5608x7685 5608x7685-169+0 8-bit DirectClass 0.020u 0:00.149
PSD_RGB_Test.psd=>PSD_RGB_Test-8.icc[8] PSD 5444x7370 5444x7370+36-107 8-bit DirectClass 0.020u 0:00.149
PSD_RGB_Test.psd=>PSD_RGB_Test-9.icc[9] PSD 488x3169 488x3169+2328+913 8-bit DirectClass 0.020u 0:00.160
PSD_RGB_Test.psd=>PSD_RGB_Test-10.icc[10] PSD 2202x3684 2202x3684+1431+486 8-bit DirectClass 0.020u 0:00.170
PSD_RGB_Test.psd=>PSD_RGB_Test-11.icc[11] PSD 269x394 269x394+2316+1334 8-bit DirectClass 0.020u 0:00.170
PSD_RGB_Test.psd=>PSD_RGB_Test-12.icc[12] PSD 2202x3684 2202x3684+1438+527 8-bit DirectClass 0.020u 0:00.179
PSD_RGB_Test.psd=>PSD_RGB_Test-13.icc[13] PSD 92x96 92x96+2474+1097 8-bit DirectClass 0.030u 0:00.190
PSD_RGB_Test.psd=>PSD_RGB_Test-14.icc[14] PSD 797x3336 797x3336+2221+855 8-bit DirectClass 0.030u 0:00.199
PSD_RGB_Test.psd=>PSD_RGB_Test-15.icc[15] PSD 584x311 584x311+2334+1222 8-bit DirectClass 0.030u 0:00.210
PSD_RGB_Test.psd=>PSD_RGB_Test-16.icc[16] PSD 5412x7216 5412x7216-33-633 8-bit DirectClass 0.030u 0:00.210
PSD_RGB_Test.psd=>PSD_RGB_Test-17.icc[17] PSD 3307x2408 3307x2408+2064+3714 8-bit DirectClass 0.030u 0:00.219
PSD_RGB_Test.psd=>PSD_RGB_Test-18.icc[18] PSD 240x209 240x209+2116+3683 8-bit DirectClass 0.030u 0:00.230
PSD_RGB_Test.psd=>PSD_RGB_Test-19.icc[19] PSD 181x198 181x198+1962+3840 8-bit DirectClass 0.030u 0:00.230
PSD_RGB_Test.psd=>PSD_RGB_Test-20.icc[20] PSD 196x187 196x187+1979+4115 8-bit DirectClass 0.030u 0:00.240
PSD_RGB_Test.psd=>PSD_RGB_Test-21.icc[21] PSD 207x160 207x160+2172+4408 8-bit DirectClass 0.030u 0:00.250
PSD_RGB_Test.psd=>PSD_RGB_Test-22.icc[22] PSD 5445x7849 5445x7849-33-633 8-bit DirectClass 0.030u 0:00.250
PSD_RGB_Test.psd=>PSD_RGB_Test-23.icc[23] PSD 5614x7546 5614x7546-202-330 8-bit DirectClass 0.040u 0:00.260
PSD_RGB_Test.psd=>PSD_RGB_Test-24.icc[24] PSD 5614x7849 5614x7849-202-633 8-bit DirectClass 0.040u 0:00.269
PSD_RGB_Test.psd=>PSD_RGB_Test-25.icc[25] PSD 5655x7849 5655x7849-243-633 8-bit DirectClass 0.040u 0:00.280
PSD_RGB_Test.psd=>PSD_RGB_Test-26.icc[26] PSD 5658x8109 5658x8109-246-893 8-bit DirectClass 0.040u 0:00.289
PSD_RGB_Test.psd=>PSD_RGB_Test-27.icc[27] PSD 5658x8109 5658x8109-246-893 8-bit DirectClass 0.040u 0:00.289
PSD_RGB_Test.psd=>PSD_RGB_Test-28.icc[28] PSD 1472x2712 1472x2712+1828+626 8-bit DirectClass 0.050u 0:00.300
PSD_RGB_Test.psd=>PSD_RGB_Test-29.icc[29] PSD 1472x2712 1472x2712+1828+626 8-bit DirectClass 0.050u 0:00.309
PSD_RGB_Test.psd=>PSD_RGB_Test-30.icc[30] PSD 4709x6299 4709x6299+404-758 8-bit DirectClass 0.050u 0:00.320
PSD_RGB_Test.psd=>PSD_RGB_Test-31.icc[31] PSD 135x304 135x304+2503+2082 8-bit DirectClass 0.050u 0:00.330
PSD_RGB_Test.psd=>PSD_RGB_Test-32.icc[32] PSD 158x1028 158x1028+2532+1753 8-bit DirectClass 0.050u 0:00.330
PSD_RGB_Test.psd=>PSD_RGB_Test-33.icc[33] PSD 208x323 208x323+2494+2022 8-bit DirectClass 0.050u 0:00.339
PSD_RGB_Test.psd=>PSD_RGB_Test-34.icc[34] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 0.050u 0:00.350
PSD_RGB_Test.psd=>PSD_RGB_Test-35.icc[35] PSD 103x24 103x24+2563+1795 8-bit DirectClass 0.050u 0:00.350
PSD_RGB_Test.psd=>PSD_RGB_Test-36.icc[36] PSD 99x707 99x707+2562+1799 8-bit DirectClass 0.050u 0:00.359
PSD_RGB_Test.psd=>PSD_RGB_Test-37.icc[37] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 0.050u 0:00.370
PSD_RGB_Test.psd=>PSD_RGB_Test-38.icc[38] PSD 173x1030 173x1030+2521+1782 8-bit DirectClass 0.060u 0:00.370
PSD_RGB_Test.psd=>PSD_RGB_Test-39.icc[39] PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 0.060u 0:00.379
PSD_RGB_Test.psd=>PSD_RGB_Test-40.icc[40] PSD 5667x7440 5667x7440-159-221 8-bit DirectClass 0.060u 0:00.379
PSD_RGB_Test.psd=>PSD_RGB_Test-41.icc[41] PSD 5416x7216 5416x7216-4+0 8-bit DirectClass 0.060u 0:00.389

Resulting files;

Code: Select all

$ ls -al
total 1048085
drwxr-xr-x 2 www-data www-data          0 Jul 24  2013 .
drwxr-xr-x 2 www-data www-data          0 Jul 23 15:51 ..
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-0.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-10.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-11.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-12.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-13.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-14.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-15.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-16.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-17.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-18.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-19.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-1.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-20.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-21.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-22.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-23.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-24.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-25.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-26.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-27.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-28.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-29.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-2.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-30.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-31.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-32.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-33.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-34.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-35.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-36.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-37.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-38.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-39.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-3.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-40.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-41.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-4.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-5.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-6.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-7.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-8.icc
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test-9.icc
-rw-r--r-- 0 www-data www-data 1073131353 Jul 16 12:47 PSD_RGB_Test.psd
Ubuntu Server version;

Code: Select all

$ cat /etc/*-releaseDISTRIB_ID=UbuntuDISTRIB_RELEASE=12.04DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
NAME="Ubuntu"
VERSION="12.04.2 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.2 LTS)"
VERSION_ID="12.04"
Imagemagick version;

Code: Select all

$ convert -version
Version: ImageMagick 6.8.6-5 2013-07-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC HDRI
Delegates: autotrace bzlib djvu fftw fontconfig freetype gslib jng jp2 jpeg lcms lqr lzma openexr pango png ps rsvg tiff wmf x xml zlib
I have been able to reproduce this issue with the following Imagemagick versions so far;

6.7.7-10
6.7.9-10
6.8.6-5

Any help on this matter would be greatly appreciated!

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

Re: Excess ICC profiles generated during extraction from PSD

Post by fmw42 »

try

convert -verbose PSD_RGB_Test.psd[0] icc:PSD_RGB_Test.icc

That should give just one icc file
electricart
Posts: 14
Joined: 2013-07-23T17:53:31-07:00
Authentication code: 6789

Re: Excess ICC profiles generated during extraction from PSD

Post by electricart »

fmw42 wrote:try

convert -verbose PSD_RGB_Test.psd[0] icc:PSD_RGB_Test.icc

That should give just one icc file
Ahhh, much better! Thank you!

Code: Select all

PSD_RGB_Test.psd[0]=>PSD_RGB_Test.psd PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 1.0731GB 3.750u 0:20.140
PSD_RGB_Test.psd[0]=>PSD_RGB_Test.icc PSD 5412x7216 5412x7216+0+0 8-bit DirectClass 0.000u 0:00.009

Code: Select all

$ ls -al
total 1047983
drwxr-xr-x 2 www-data www-data          0 Jul 24 12:01 .
drwxr-xr-x 2 www-data www-data          0 Jul 23 15:51 ..
-rw-r--r-- 0 www-data www-data       2532 Jul 24  2013 PSD_RGB_Test.icc
-rw-r--r-- 0 www-data www-data 1073131353 Jul 16 12:47 PSD_RGB_Test.psd
I was just thinking about adding the [0] option. Do you know by any chance when this behaviour started? We had it working on a previous version of Imagemagick without the [0] I believe, though I could be wrong?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Excess ICC profiles generated during extraction from PSD

Post by fmw42 »

I don't know, but many things like string formats repeat for each layer of a multi-layer image without [0]
electricart
Posts: 14
Joined: 2013-07-23T17:53:31-07:00
Authentication code: 6789

Re: Excess ICC profiles generated during extraction from PSD

Post by electricart »

fmw42 wrote:I don't know, but many things like string formats repeat for each layer of a multi-layer image without [0]
No problem! Thanks for all your help. Being able to add [0] will fix everything for my purposes anyway. Thanks again!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Excess ICC profiles generated during extraction from PSD

Post by snibgo »

I don't know what is actually stored in the PSD file, but IM attaches profiles to images, not files, so a file with multiple images can contain multiple (different) profiles, one per image.
snibgo's IM pages: im.snibgo.com
Post Reply