Some PDF-files get stuck on readImage()

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
skogga
Posts: 3
Joined: 2014-03-11T08:50:38-07:00
Authentication code: 6789

Some PDF-files get stuck on readImage()

Post by skogga »

I've got problems with some of our PDF-files (approx. 1 out of 30), that just get stuck on "readImage", it stays there until I close the process or the script times out.

The trouble seems to have some connection to the CMYK colorspace as it doesn't occur when using standard RGB and it only occurs when going through the PHP-addon.

I've spent weeks trying to solve this, but the the biggest problem is that it won't give me any error messages to go for.

Here's some of the troubling files,
http://feedr.se/upload/PDFFiles.zip

Ghostscript version: 9.10
Imagick: 6.8.7-0 2013-09-18 Q16 (32-bit)

System: Windows Server 2008 (32-bit), 4GB RAM
Using PHP 5.4 (Imagick 3.1.2, Non-Thread-Safe, 32-bit)

Code: Select all

$im = new Imagick();
$im->setColorspace( imagick::COLORSPACE_CMYK ); // <-- If I change this line to SRGB most of the files start working, but with the wrong colors
$im->setResolution( 144, 144 );
$im->readImage('pdffile.pdf[0]'); // <-- This is where it get stuck

// and some more code...
Thanks in advance.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Some PDF-files get stuck on readImage()

Post by dlemstra »

There have been some bug reports with Ghostscript getting stuck on some files. They are aware of this issue and it should be solved in the next release. Maybe you could try and see if downgrading your version resolves the issue. I have no clue when they will publish a new release.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
skogga
Posts: 3
Joined: 2014-03-11T08:50:38-07:00
Authentication code: 6789

Re: Some PDF-files get stuck on readImage()

Post by skogga »

Thanks, I will try that.
skogga
Posts: 3
Joined: 2014-03-11T08:50:38-07:00
Authentication code: 6789

Re: Some PDF-files get stuck on readImage()

Post by skogga »

The problem got solved with release 9.12 of GhostScript, that was released just a couple of days ago. =)
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Some PDF-files get stuck on readImage()

Post by dlemstra »

Thank you for getting back to us. I can see that Ghostscript 9.14 is available now also. I hope it is still fixed :)
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply