IM can't read its own PSD files if it contains layers

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

IM can't read its own PSD files if it contains layers

Post by jn0101 »

Using ImageMagick 6.4.5 2009-06-04 Q16 OpenMP on Ubuntu Linux and a PSD file with 3 layers:
(availabable at http://javabog.dk/filer/psd/nem_154049_fc_JNSMALL.psd)
  • $ convert nem_154049_fc_JNSMALL.psd x.psd
    $ convert x.psd y.psd
    convert: maximum channels exceeded `x.psd' @ coders/psd.c/ReadPSDImage/858.
    convert: missing an image filename `y.psd' @ wand/convert.c/ConvertImageCommand/2710.
    $

Identify correctly shows the 3 layers:
  • $ identify nem_154049_fc_JNSMALL.psd
    nem_154049_fc_JNSMALL.psd[0] PSD 248x239 248x239+0+0 8-bit DirectClass 346kb 0.190u 0:02
    nem_154049_fc_JNSMALL.psd[1] PSD 248x239 248x239+0+0 8-bit DirectClass 346kb 0.190u 0:02
    nem_154049_fc_JNSMALL.psd[2] PSD 24x14 24x14+158+200 8-bit DirectClass 346kb 0.180u 0:02
I can also extract each as tiff and view them in any tool. So reading is OK.




Ive just checked out the latest SVN version. Same result:
  • $ /usr/local/im/im6.5.4/bin/convert nem_154049_fc_JNSMALL.psd x.psd
    $ /usr/local/im/im6.5.4/bin/convert x.psd y.psd
    convert: maximum channels exceeded `x.psd' @ psd.c/ReadPSDImage/856.
    convert: missing an image filename `y.psd' @ convert.c/ConvertImageCommand/2772.
However, it seems reading is broken in newest version: The layers are not found:
  • $ /usr/local/im/im6.5.4/bin/identify nem_154049_fc_JNSMALL.psd
    nem_154049_fc_JNSMALL.psd PSD 248x239 248x239+0+0 8-bit DirectClass 346kb

I might be of interest to you that open source GIMP seems to be able to handle layers in PSD files.

Thanks for a great tool!
Jacob
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM can't read its own PSD files if it contains layers

Post by magick »

The default is to ping the image which is quite efficient but only gets attributes from the first image. To get all the layers, type
  • identify +ping nem_154049_fc_JNSMALL.psd
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

Re: IM can't read its own PSD files if it contains layers

Post by jn0101 »

Thanks for your reply.

You are absolutely right, using +ping makes newest IM also identify all 3 layers in the original file.

Code: Select all

$ /usr/local/im/im6.5.4/bin/identify +ping nem_154049_fc_JNSMALL.psd
nem_154049_fc_JNSMALL.psd[0] PSD 248x239 248x239+0+0 8-bit DirectClass 346kb 
nem_154049_fc_JNSMALL.psd[1] PSD 248x239 248x239+0+0 8-bit DirectClass 346kb 
nem_154049_fc_JNSMALL.psd[2] PSD 24x14 24x14+158+200 8-bit DirectClass 346kb 

Thus, "only" remains that IM can read its own PSD files :-)

Code: Select all

$ /usr/local/im/im6.5.4/bin/identify  x.psd 
x.psd PSD 248x239 248x239+0+0 8-bit DirectClass 388kb 
(I suppose this is becaurs the extra layers are not examined when not using +ping)

Using +ping gives the same error as in the older 6.4.5:

Code: Select all

$ /usr/local/im/im6.5.4/bin/identify +ping x.psd 
identify: maximum channels exceeded `x.psd' @ psd.c/ReadPSDImage/856.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM can't read its own PSD files if it contains layers

Post by magick »

Thus, "only" remains that IM can read its own PSD files :-)
\

We're working on the problem. We'll have a fix within a day or two.
Post Reply