Page 1 of 1

Create several picture for one picture in one way

Posted: 2012-12-05T08:55:20-07:00
by amaxime95
Hello.

I've got an original image for which I want to create a series of image with a variety of resolutions:

Initially I was doing something like this ...

Code: Select all

convert '1.jpg' -gravity center -resize 190x168! -quality 70 '/converted/1.png'
convert '1.jpg' -gravity center -resize 320x240! -quality 100  '/converted/2.png''
But I want to do with one command
I tried this :

Code: Select all

convert '1.jpg' 
-write mpr:orig +delete 
mpr:orig -gravity center -resize 190x168! -quality 70 -write '/converted/1.png' +delete 
mpr:orig -gravity center -resize 320x240! -quality 100  '/converted/2.jpg' +delete
OR

Code: Select all

convert '1.jpg' 
-gravity center -resize 190x168! -quality 70 -write '/converted/1.png'  +delete	
-gravity center -resize 320x240! -quality 100  '/converted/2.jpg' 
But it doesn't work with error :

Code: Select all

convert: unable to open image `/converted/2.jpg': No such file or directory @ blob.c/OpenBlob/2480.
Any suggestions?

Thanks !

Re: Create several picture for one picture in one way

Posted: 2012-12-05T11:44:06-07:00
by fmw42
You are referencing an absolute directory at the root of your tree. If you really want a subdirectory of your current directory, then leave off the / in your output image, so that it is a relative path

This is how I would do it. You can modify the command for your application


convert logo: -write mpr:image +delete \
\( mpr:image -resize 50% -write 1tmp1/logo1.jpg \) \
\( mpr:image -resize 25% -write 1tmp1/logo2.jpg \) \
null:

You should not need -gravity center