Page 1 of 1

Problem converting eps and place on canvas in one command

Posted: 2009-12-03T08:06:58-07:00
by Znooky
Hi!
I have some problem with IM and I need some expert advice if it's possible to do what I want.

I have a image in eps format that I want to convert to jpg and placed in the bottom of a white canvas. Here is my code with successful result

Code: Select all

REM Create the Canvas
convert -size 400x400 xc:white c:\temp\canvas_temp\canvas_white.jpg

REM Convert the SourceImage
convert -density 300 -units PixelsPerInch Source_Image.eps -bordercolor white -border 1 -trim +repage -resize 400x400 -density 72 -units PixelsPerInch c:\temp\canvas_temp\Source_Image_temp.png

REM Add the converted Image to the created canvas
composite -gravity South c:\temp\canvas_temp\Source_Image_temp.png c:\temp\canvas_temp\canvas_white.jpg Converted_Image.jpg
'
However I would like to do this in just one command. This is what I have tried without success

Code: Select all

convert -size 400x400 xc:white -density 300 -units PixelsPerInch Source_Image.eps -bordercolor white -border 1 -trim +repage -resize 400x400 -density 72 
-units PixelsPerInch c:\temp\canvas_temp\Source_Image.png -gravity South -composite Destination_Image.jpg
After running I get this error message from IM

convert: geometry does not contain image `white' @ attribute.c/GetImageBoundingB
ox/238.
convert: unable to open image `c:\temp\canvas_temp\Source_Image.png': No such file or directory @ blob.c/OpenBlob/2480.
convert: unable to open file `c:\temp\canvas_temp\Source_Image.png' @ png.c/ReadPNGImage/2883.

The reason why I temporary want to convert the eps to png before adding it to the canvas is because if I convert it directly to jpg and then attache it to the canvas I only get a white canvas without any image in it.

Is it possible in IM to do all this in one command or do I have to create a bat file and split it into many parts?

I'm using the following version of IM
Version: ImageMagick 6.5.7-3 2009-10-27 Q16

OS: Windows XP

Kind Regards
Znooky

Re: Problem converting eps and place on canvas in one command

Posted: 2009-12-03T10:09:25-07:00
by fmw42
you need to use parenthesis processing. see http://www.imagemagick.org/Usage/basics/#parenthesis