unable to open image

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
eswari
Posts: 1
Joined: 2019-05-15T21:03:19-07:00
Authentication code: 1152

unable to open image

Post by eswari » 2019-05-15T21:13:18-07:00

Hi All,

I am using the below command to print a gif file through laser printer from unix

convert image -density 100 -rotate 270 image.ps && lp -o fit-to-page -d printer1 -n 1 image.ps

When I am using this command directly in the command prompt from anywhere (form the folder where the image is placed or outside of the folder with full path), print is happening successfully.

When I use same command within a web application which is deployed in tomcat getting the below error

convert: unable to open image `image.ps': No such file or directory @ error/blob.c/OpenBlob/2701.
convert: unable to open image `&&': No such file or directory @ error/blob.c/OpenBlob/2701.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/504.
convert: unable to open image `lp': No such file or directory @ error/blob.c/OpenBlob/2701.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/504.
convert: unrecognized option `-o' @ error/convert.c/ConvertImageCommand/2314.
for:image

I have searched for this error in google but didn't help anything. How to resolve these errors and print the gif files to laser printer from unix

Thanks,
Eshwari

snibgo
Posts: 12030
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: unable to open image

Post by snibgo » 2019-05-16T02:37:29-07:00

"&&" is a shell (eg bash or Windows) facility which joins commands together into a single line so they are run, one after the other. From the error message, "&&" is not interpreted by your shell, so it is passed as an argument to the IM program "convert".

Because "&&" and other junk is passed to "convert", that program interprets "image.ps" as an input file, not an output file. It is trying to read it, and fails.

I don't know tomcat. I suggest you consult tomcat documentation for multiple commands.
snibgo's IM pages: im.snibgo.com

Post Reply