Page 1 of 1

convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T10:20:28-07:00
by kamal2222ahmed
getting error when running the convert command:

$ convert -density 300x300 example.pdf -quality 100 test.jpg
convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3235.


the user is ec2-user


but if i run the same command as tomcat7 , it works.

$convert -version
Version: ImageMagick 7.0.1-3 Q16 x86_64 2016-05-13 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl openexr pangocairo png ps rsvg tiff webp wmf x xml zlib

i installed ImageMagick 7.1 via Chef/rpms using the ImageMagick.SPEC file in the 7.1 tar.gz

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T11:23:08-07:00
by fmw42
Imagemagick 7 use "magick" rather than "convert". Also try giving the full path to magick for where you installed Imagemagick 7.

Do you have two versions of IM installed?

What do you get from

Code: Select all

type -a convert
or

Code: Select all

type -a magick

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T11:40:46-07:00
by kamal2222ahmed
$type -a convert
convert is /usr/bin/convert

$ type -a magick
magick is /usr/bin/magick

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T11:42:35-07:00
by kamal2222ahmed
also:
$ which convert
/usr/bin/convert

[ec2-user@el2-ft110-app1 ~]$ which magick
/usr/bin/magick

[ec2-user@el2-ft110-app1 ~]$ ls -l /usr/bin/convert
lrwxrwxrwx 1 root root 6 Jun 2 02:55 /usr/bin/convert -> magick

[ec2-user@el2-ft110-app1 ~]$ ls -l /usr/bin/magick
-rwxr-xr-x 1 root root 19064 May 13 20:49 /usr/bin/magick

[ec2-user@el2-ft110-app1 ~]$ /usr/bin/convert -version
Version: ImageMagick 7.0.1-3 Q16 x86_64 2016-05-13 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl openexr pangocairo png ps rsvg tiff webp wmf x xml zlib

[ec2-user@el2-ft110-app1 ~]$ /usr/bin/magick -version
Version: ImageMagick 7.0.1-3 Q16 x86_64 2016-05-13 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl openexr pangocairo png ps rsvg tiff webp wmf x xml zlib

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T11:45:01-07:00
by fmw42
Sorry, I do not see any difference and do not know why it is failing.

Is it the very same PDF image or a copy run from each account? Perhaps one copy is bad?

It looks like a permission issue to access the file from the first account.

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T11:58:06-07:00
by kamal2222ahmed
could this be due to the fact that if we see ImageMagick.SPEC , the required RPMs are ALL -devel versions:

BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
BuildRequires: ghostscript-devel, djvulibre-devel
BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
BuildRequires: libX11-devel, libXext-devel, libXt-devel
BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
BuildRequires: jbigkit-devel
BuildRequires: openjpeg2-devel >= 2.1.0


but i have installed NON-DEVEL binary rpms ?

-rw-r--r-- 1 root root 1278560 May 26 14:49 fftw-3.2.1-3.1.el6.rpm
-rw-r--r-- 1 root root 69416 May 26 11:08 ImageMagick-7.0.1-3.rpm
-rw-r--r-- 1 root root 2145852 May 26 11:08 ImageMagick-libs-7.0.1-3.x86_64.rpm
-rw-r--r-- 1 root root 47560 May 26 11:08 jbigkit-libs-2.0-11.el7.x86_64.rpm
-rw-r--r-- 1 root root 139860 May 26 14:49 liblcms2-2-2-2.6-67.2.rpm
-rw-r--r-- 1 root root 139860 May 26 14:49 libopenjp2-7-2.1.0-24.3.rpm
-rw-r--r-- 1 root root 215532 May 26 14:49 libwebp-0.4.3-3.el6.rpm
-rw-r--r-- 1 root root 102280 May 26 15:26 openjpeg2-2.1.0-7.el6.rpm

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T12:51:38-07:00
by fmw42
Sorry, I do not know much about installation on Linux

Re: convert: unable to create temporary file 'example.pdf': Permission denied @ error/pdf.c/ReadPDFImage/475.

Posted: 2016-06-02T14:02:05-07:00
by snibgo
I've never seen convert try to create a file with the same name as in input PDF.

I suppose it tries to run Ghostscript. "-verbose" as the first option should tell you. Can both users run standalone Ghostscript?

"-debug all" may say where it is failing.