Page 1 of 1

pixel cache allocation failed when convert a small PSD

Posted: 2015-09-17T20:35:44-07:00
by kfitfk
I just installed the latest version on a server today: Version: ImageMagick 6.9.2-1 Q16 x86_64 2015-09-18.

Code: Select all

convert file.psd[1] output1.png
When I run the command above to extract the first layer as a PNG file, I got the following errors.

Code: Select all

convert: pixel cache allocation failed `file.psd' @ error/cache.c/OpenPixelCache/3559.
convert: memory allocation failed `file.psd' @ error/psd.c/ReadPSDChannel/1094.
convert: no images defined `output1.png' @ error/convert.c/ConvertImageCommand/3230.
The PSD file size is pretty small, 1.8MB, 520x280. I can run the command successfully on my Mac using the same IM version.

Running

Code: Select all

convert -list resource
on the server shows the following:

Code: Select all

Resource limits:
  Width: 214.7MP
  Height: 214.7MP
  Area: 101.48GP
  Memory: 47.257GiB
  Map: 94.514GiB
  Disk: unlimited
  File: 98304
  Thread: 16
  Throttle: 0
  Time: unlimited
I have no idea why there's a memory issue with such a small file. I've searched the other related topics, but can't find a way to solve this. The PSD file can be downloaded here:

https://www.dropbox.com/s/dhptm83v6q2jr ... g.psd?dl=0

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-09-17T20:53:02-07:00
by fmw42
I cannot seem to be able to download your file. I get no action from your link to show it is getting to that link.

Nevertheless, if you can run the conversion from the other system, it is not likely the PDF file.

Check your version of Ghostscript and whether IM can see it. Do you have all your delegates installed? Is IM installed properly? What platform are you on? Did you install IM from source or binary?

What do you get from

Code: Select all

convert -version
and

Code: Select all

convert logo: logo.pdf
convert logo.pdf logo.gif

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-09-17T21:45:10-07:00
by kfitfk
The server is Red Hat Enterprise Linux Server release 5.7 (Tikanga)

Code: Select all

$ convert -version
Version: ImageMagick 6.9.2-1 Q16 x86_64 2015-09-18 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jng jpeg png webp x xml
And the 2 commands you listed runs OK.

I share 2 PSD files on dropbox. The one which contains a lot of squares converts fine. But when using convert on the other file, it fails.

https://www.dropbox.com/s/7q0pmset9osr4 ... s.psd?dl=0
https://www.dropbox.com/s/dhptm83v6q2jr ... g.psd?dl=0

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-09-17T23:21:55-07:00
by fmw42
Sorry, it is late here and I misread PDF for PSD. I get a similar error using IM 6.9.2.1 Q16 Mac OSX

Code: Select all

convert mr_bu_bg.psd[1] mr_bu_bg.png
 
convert: pixel cache allocation failed `mr_bu_bg.psd' @ error/cache.c/OpenPixelCache/3559.
convert: memory allocation failed `mr_bu_bg.psd' @ error/psd.c/ReadPSDChannel/1094.
convert: no images defined `mr_bu_bg.png' @ error/convert.c/ConvertImageCommand/3230.
So there may be a bug in iM or in your PSD file. Your PSD file has multiple layers and some are on and some are off. I opened it in my old PS (CS) and disabled the extraneous layer that was not doing anything, then saved to PSD without layers. That file converted just fine.

So perhaps IM cannot handle the extra layers? I would report this on the bugs forum and see what the Developers say.

Just post a Bug report and put the link back to here.

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-09-17T23:34:42-07:00
by kfitfk
Well, I'm not sure now if this has something to do with the latest 6.9.2.x version.

The mr_bu_bg.psd that I posted above has 2 layers off, 2 layers on.

On my mac, I have Version: ImageMagick 6.9.1-10 Q16 x86_64 2015-08-04. And I have another Linux test server which has Version: ImageMagick 6.9.1-8 Q16 x86_64 2015-07-16. Both machines can run the convert command just fine, no matter on which file I listed before.

I guess I should try 6.9.1.x on my production server to see if things work. This may better confirm whether there's a bug in the latest version.

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-09-17T23:55:36-07:00
by dlemstra
I can confirm this is a bug in ImageMagick. I made a mistake when setting the endianness in the PSD reader. I made a change that set this to late. A patch has been pushed to our GIT repository to resolve this. This will be resolved in ImageMagick 6.9.2-2.

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-09-18T01:17:44-07:00
by kfitfk
dlemstra wrote:I can confirm this is a bug in ImageMagick. I made a mistake when setting the endianness in the PSD reader. I made a change that set this to late. A patch has been pushed to our GIT repository to resolve this. This will be resolved in ImageMagick 6.9.2-2.
Got it.

I just downgraded the IM on my production machine to 6.9.1, everything works.

Thank you guys :)

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-10-22T03:26:07-07:00
by tomk
Hi dlemstra,

I have run into the same issue, and tried upgrading to the latest version of imagemagick, but this seems to still fail:

Code: Select all

~ $ convert --version
Version: ImageMagick 6.9.2-4 Q8 x86_64 2015-10-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP 
Delegates (built-in): bzlib cairo djvu fontconfig freetype gvc jbig jng jpeg lcms lqr lzma openexr pangocairo png rsvg tiff webp wmf x xml zlib

~ $ convert 'mr_bu_bg.psd' -auto-orient -quiet -format 'width=%w height=%h transparent=%A colorspace=%[colorspace] color_profile=%[profile:icc] format=%m  %[*]%[EXIF:*]' info:
convert: PixelCacheAllocationFailed `mr_bu_bg.psd' @ error/cache.c/OpenPixelCache/3559.
convert: MemoryAllocationFailed `mr_bu_bg.psd' @ error/psd.c/ReadPSDChannel/1094.
convert: NoImagesDefined `info:' @ error/convert.c/ConvertImageCommand/3230.


Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-10-22T04:31:46-07:00
by dlemstra
I think you have the same issue as reported here: viewtopic.php?f=3&t=28461. This will be fixed in the next release of ImageMagick (6.9.2-5)

Re: pixel cache allocation failed when convert a small PSD

Posted: 2015-10-22T05:05:52-07:00
by tomk
Indeed, the latest version from git works.

Do you know by any chance when the next version is going to be released or is there any other way to check?

Thanks, Thomas