Page 1 of 1

Searching for specific images with IM

Posted: 2008-11-15T14:35:50-07:00
by dargaud
Hello all,
I use IM irregularly so I'm not fully aware of all its functionalities.

Is it possible to use it to search for images (in a directory) with certain characteristics. For instance to list all the images of type tif that have more than 20 Mpix ? This could be done by doing "find -name \*.tif | identify -format ... | sort ..." but maybe there are faster and better ways to do it...

But first I don't know what kind of -format will give me a MPix value and second this is extremely slow.

Re: Searching for specific images with IM

Posted: 2008-11-15T15:44:17-07:00
by fmw42
dargaud wrote:Hello all,
I use IM irregularly so I'm not fully aware of all its functionalities.

Is it possible to use it to search for images (in a directory) with certain characteristics. For instance to list all the images of type tif that have more than 20 Mpix ? This could be done by doing "find -name \*.tif | identify -format ... | sort ..." but maybe there are faster and better ways to do it...

But first I don't know what kind of -format will give me a MPix value and second this is extremely slow.

See %b at http://www.imagemagick.org/script/escape.php for the file size
See -ping option to make identify -format faster http://www.imagemagick.org/Usage/basics/#controls

But I think your best bet is to stick with shell programming. You should be able to get the file size from ls-al. But I am no expert on these matters.