PSD files do not process in IM

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.
graemeNPS
Posts: 64
Joined: 2009-01-12T14:25:55-07:00

PSD files do not process in IM

Post by graemeNPS »

We use ImageMagick to render a wide variety of formats to jpeg thumbnails and previews in a Windows environment.
A customer has reported some PSD files that fail in IM. They have given us permission to send these along for testing.
We have tried these both in our code which uses the prebuilt dlls and in convert from the command line, and basically the code spins for a few minutes, then crashes.
We run on 6.8.5-5 q8, but have also tested against the latest (6.8.9) 32 and 64 bit codes and get the same result.


Files are on our ftp site:
site:ftp.northplains.com
user:publicforum
pass:543publicforum123
files: imagemagick_psd_problems/IM_broken_psd.zip

Please advise on any workarounds, what the problems may be in the files, and a time frame for a fix.
Our customer has a lot of PSD files, and is anxious for a fix.
Thanks,
graeme
our ticket #: 8404
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD files do not process in IM

Post by fmw42 »

I tried to load Kenneth_test_1_file_only.psd into my old PS CS and it complained about unknown data a number of times, then tried to load the file and hung. I am no expert on PS, but it may be that the files have newer format data than my old PS can handle or is malformed. I do not think that IM can handle PSD files with other than basic layers. It won't handle other more exotic types of layers such as group layers and effects layers.

Also your pdf files are very large. You may be running out of memory. see

http://www.imagemagick.org/Usage/files/#massive
http://www.imagemagick.org/script/resou ... nvironment
viewtopic.php?f=1&t=24904&p=107434&hilit=limit#p107434
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PSD files do not process in IM

Post by snibgo »

I tried to download IM_broken_psd.zip but ftp complained about a time-out. Possibly because electrons move slowly in my part of the world.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD files do not process in IM

Post by fmw42 »

snibgo wrote:I tried to download IM_broken_psd.zip but ftp complained about a time-out. Possibly because electrons move slowly in my part of the world.
It took a very long time for me to download that zipped file on a fast Comcast network. There are 4 files ranging from about 20 MB to 100 MB each.
graemeNPS
Posts: 64
Joined: 2009-01-12T14:25:55-07:00

Re: PSD files do not process in IM

Post by graemeNPS »

I have the individual psd and zips in the folder
042714_TS_333333.psd
042714_TS_333333.zip
042814_TS_333333.psd
042814_TS_333333.zip
050114_TS_333333.psd
050114_TS_333333.zip
Kenneth_test_1_file_only.psd
Kenneth_test_1_file_only.zip
graemeNPS
Posts: 64
Joined: 2009-01-12T14:25:55-07:00

Re: PSD files do not process in IM

Post by graemeNPS »

IM_broken_PSD_Capture.PNG
is a screen capture of using convert (6.8.5) on one of the images.

I can open all of the images in Photoshop cs5.1 (32 bit), if I agree to dialog box options to flatten or keep layers.
My colleague can open them in PhotoShop CS6 with no problem.
The XMP packet indicates they are created in PS CS6 Macintosh.

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

Re: PSD files do not process in IM

Post by fmw42 »

Do you have any special layers such as group layers or effects? What is different about these files from ones that work in terms of kinds of layers or other feature that have been used in creating them in PS? Open a good one and a bad one and see what differences there are? Try to pin down what is causing the issue.

I guess my PS CS is too old to handle your PS CS 6 files.

Can you open them in GIMP? Perhaps a GIMP script might work better for you if GIMP opens them.

I will pass this on to one of the IM developers and see if he can see in the code where it is breaking.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PSD files do not process in IM

Post by snibgo »

identify -debug all 042814_TS_333333.psd

gets as far as ...

Code: Select all

  Domain: Path; rights=Read; pattern="042814_TS_333333.psd" ...
2014-05-21T19:55:53+01:00 0:00.088 0.016u 6.8.9 Blob identify.exe[416]: blob.c/O
penBlob/2540/Blob
    read 3 magic header bytes
2014-05-21T19:55:53+01:00 0:00.103 0.016u 6.8.9 Coder identify.exe[416]: psd.c/R
eadPSDImage/1626/Coder
    Image is 600 x 367 with channels=3, depth=8, mode=RGB
2014-05-21T19:55:53+01:00 0:00.103 0.016u 6.8.9 Coder identify.exe[416]: psd.c/R
eadPSDImage/1710/Coder
    reading image resource blocks - 7543460 bytes
... then seems to hang, taking 12% of my CPU cycles and very slowly increasing memory requirement.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PSD files do not process in IM

Post by dlemstra »

Your images contain really large XMP profiles but after waiting for a while I am getting a correct image with ImageMagick 6.8.9-1. I have only tested 'Kenneth_test_1_file_only.psd' and '042714_TS_333333.psd'.

Code: Select all

convert.exe Kenneth_test_1_file_only.psd[0] Kenneth_test_1_file_only.png
convert.exe 042714_TS_333333.psd[0] 042714_TS_333333.png
I have made a lot of improvements to the PSD coder the last year so I would really advise you to use the latest version of ImageMagick. I will see if I can improve the speed of the parsing of the xmp profile.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
graemeNPS
Posts: 64
Joined: 2009-01-12T14:25:55-07:00

Re: PSD files do not process in IM

Post by graemeNPS »

Thanks for all the replies.
I have downloaded and tested with ImageMagick-6.8.9-1-Q16-x86-dll.exe and it works, albeit slowly, on the psd files.

So I have built our code in Q16 x86 mode with the 6.8.9 sources, and our code works, again very slowly, with the dlls from your installer and our dll.

(We have historically used your installers for the IM dlls, and linked our code against the dynamic build libs.)

However, we have used Q8 builds up to now, as they have been somewhat faster than Q16, but I do not see on your Windows Binary Release page a Q8 x86 build.
http://www.imagemagick.org/script/binar ... hp#windows

These are the installer listed there:
ImageMagick-6.8.9-1-Q16-x64-static.exe download download Win64 static at 16 bits-per-pixel

ImageMagick-6.8.9-1-Q8-x64-dll.exe download download Win64 dynamic at 8 bits-per-pixel

ImageMagick-6.8.9-1-Q8-x64-static.exe download download Win64 static at 8 bits-per-pixel

ImageMagick-6.8.9-1-Q16-x86-dll.exe download download Win32 dynamic at 16 bits-per-pixel

ImageMagick-6.8.9-1-Q16-x86-static.exe download download Win32 static at 16 bits-per-pixel

ImageMagick-6.8.9-1-Q16-x86-windows.zip download download Portable Win32 static at 16 bits-per-pixel. Just copy to your host and run (no installer, no Windows registry entries).


We would really like a 6.8.9-1 Q8 x86 build, so we can get the advantages of using your installer and the Q8 speed we are used to.
Will you be posting a Q8 x86 build?

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

Re: PSD files do not process in IM

Post by fmw42 »

Can you live without the xmp profile? Perhaps just use -strip to remove it and see if that reads/processes faster?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PSD files do not process in IM

Post by dlemstra »

That will not help Fred. I am working on improving the speed of parsing the xmp profile.It looks promising.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD files do not process in IM

Post by fmw42 »

dlemstra wrote:That will not help Fred. I am working on improving the speed of parsing the xmp profile.It looks promising.
But is it needed to be passed to the JPG thumbnails? If not, then cannot one just strip it before reading the PSD or does one have to read the PSD in order to do the strip?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PSD files do not process in IM

Post by snibgo »

I notice that ...

Code: Select all

exiftool -s2 -all -b -X -fXMP:XMP 042814_TS_333333.psd >x.txt
... spews out 4 MB of XMP metadata, but takes only about 4 seconds. Maybe IM is doing something else, of course.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PSD files do not process in IM

Post by dlemstra »

@fred: Strip only works after the whole PSD has been read.

@snibgo: We are parsing the whole xmp profile but I am making some changes to ignore parts of the xml. I am almost done with the changes and it should be available in the next release. convert 042814_TS_333333.psd[0] 042814_TS_333333.png now 'only' takes 6 seconds on my machine.

EDIT: The patch has been submitted to our svn repository and this change will be included in the next release (6.8.9-2).
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply