Some PDF-files get stuck on readImage()
Posted: 2014-03-11T08:59:11-07:00
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)
Thanks in advance.
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...