Page 1 of 1

ImageMagick inches cm

Posted: 2010-04-13T03:01:02-07:00
by sashs
Hello,

is it possible to resize an image, if i only have the size in inches or centimetres?

Regards

sashs

Re: ImageMagick inches cm

Posted: 2010-04-13T07:54:42-07:00
by snibgo
As far as I know, IM has no options to directly resize in inches or centimetres. You need to do the calculations in a script.

Re: ImageMagick inches cm

Posted: 2010-04-13T22:09:51-07:00
by sashs
Thanx.
My knowing about graphic processing is not good. Could you give me a little example for this?

Regards

sashs

Re: ImageMagick inches cm

Posted: 2010-04-13T23:55:13-07:00
by Bonzo
How are you running the IM commands ? Linux, Windows, php etc.

Re: ImageMagick inches cm

Posted: 2010-04-14T00:32:30-07:00
by sashs
I run IM on Windows. I do all with Java, but with system-commands (command-line).

Regards

sashs

EDIT: I don't use JMagick.

Re: ImageMagick inches cm

Posted: 2010-04-14T09:38:19-07:00
by snibgo
set INFILE=liquid.jpg
set OUTFILE=liquid_resized.jpg
set MAX_HEIGHT_INCHES=3
set MAX_WIDTH_INCHES=5

FOR /F "usebackq" %%i IN (`identify -format "MAX_WIDTH_PIXELS=%%[fx:resolution.x*%MAX_WIDTH_INCHES%]\nMAX_HEIGHT_PIXELS=%%[fx:resolution.y*%MAX_HEIGHT_INCHES%]" %INFILE%`) DO @set %%i

convert %INFILE% -resize %MAX_WIDTH_PIXELS%x%MAX_HEIGHT_PIXELS% %OUTFILE%

Re: ImageMagick inches cm

Posted: 2010-04-18T13:31:13-07:00
by sashs
Thanx. It was very helpful.

Regards

sashs