Error converting PDF to PNG Imagemagick: unable to create temporary file

696 views Asked by At

I have written a php script to programmatically create a PNG thumbnail for every PDF in a folder. I use imagemagick to do it, executing the following command:

exec('convert file.pdf[0] file.png');

Everything was working but suddenly I've started to get an error every time I try:

convert: unable to create temporary file file.pdf: ӓ?U|SvU?T???[U @ error/pdf.c/ReadPDFImage/381. convert: missing an image filename file.png @ error/convert.c/ConvertImageCommand/2940.

Of course, I've tried directly in the command line and the same happens.

Any idea?

PS: I´m working with ImageMagick 6.6.0-4

1

There are 1 answers

0
user2261050 On

I´ve seen that the temp directory is full of files previously created by imagemagick. I don´t know the reason why they are still there. But if i delete them, everything starts to work again.