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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kamal2222ahmed
Posts: 13
Joined: 2016-05-06T14:25:33-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
kamal2222ahmed
Posts: 13
Joined: 2016-05-06T14:25:33-07:00
Authentication code: 1151

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

Post by kamal2222ahmed »

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

$ type -a magick
magick is /usr/bin/magick
kamal2222ahmed
Posts: 13
Joined: 2016-05-06T14:25:33-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
kamal2222ahmed
Posts: 13
Joined: 2016-05-06T14:25:33-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Sorry, I do not know much about installation on Linux
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply