Page 1 of 1

Identify - Orientation - images size mm

Posted: 2010-01-15T12:09:17-07:00
by Albireo
Hello!

I want to resize all the new images. (possibly change the orientation)
(I understand that it can be done in many ways, but what is the best way?)
but don't resize the images that already have the right size.

Is the only way to do this by creating a file with
"identify-verbose" command like this:

Code: Select all

Identify -verbose pic1.jpg > res_pic1.txt
then search in the text file after desired information

When the images are large (they are from the beginning), it takes a while.....

(I should now look how to reduce the size of an image without losing information - but I think I find it in any way) :)

//Jan

Re: Identify - Orientation - images size mm

Posted: 2010-01-15T12:18:44-07:00
by Bonzo
How are you using your code - batch file, bash file, php, etc.

There are some resize options see: http://www.imagemagick.org/script/comma ... p#geometry but IM reads the image in first to see if the conditions are met then saves it again. This is OK for lossless images but jpg will be compressed.

Re: Identify - Orientation - images size mm

Posted: 2010-01-15T12:20:28-07:00
by fmw42
what defines the right size?

To resize only if larger than some size, then

convert image -resize "WidthxHeight>" result

see > symbol at

http://www.imagemagick.org/script/comma ... p#geometry

Re: Identify - Orientation - images size mm

Posted: 2010-01-15T16:30:21-07:00
by Albireo
Thank you for the answer.
Bonzo wrote:How are you using your code - batch file, bash file, php, etc..
I want to manage all the images automatically by doing a "batch file" with AutoHotkey.
(maybe 500-1000 pcs)
Bonzo wrote:...........IM reads the image in first to see if the conditions are met then saves it again.....
Most of the images will be stored in jpg format :(
Is it only "-resize", which reads the image and save it again?
fmw42 wrote:what defines the right size?
The pictures will be published on the internet.
On the site you can see a small image, when you click on it, opens a larger image
(Right now I don't know what "right-size" is.)
fmw42 wrote:To resize only if larger than some size.........
Most images are designed to be printed on large format printers (high resolution)
(Would not be great if these pictures are published directly on the web :-))

and hard to keep track of all the pictures manually

My question remains:
Is it easy to get the size of the picture? (or another parameter)

(I can easy read the picture size in kb on the hard disk but I can't read other parameters....)

//Jan

Re: Identify - Orientation - images size mm

Posted: 2010-01-15T19:38:08-07:00
by fmw42
My question remains:
Is it easy to get the size of the picture? (or another parameter)
Easy to get width, height or filesize (or many other parameters)

see http://www.imagemagick.org/script/escape.php

convert image -format "width=%w height=%h filesize=%b" info:

If you want to put them into variables, then one at a time:

width=`convert image -ping -format "%w" info:`

The above is unix. I am not sure how you would do that in Windows as windows does not like the back quotes.

see
http://www.imagemagick.org/Usage/windows/

and see el_supremo's comments at viewtopic.php?f=1&t=15352