home | list info | list archive | date index | thread index

[OCLUG-Tech] find images by size

The short story.

I've got a directory of about 29,000 images. I accidentally dumped in a bunch 
(+500) of images that are the wrong dimensions. I need to find those images 
copy them to a tmp directory convert them to the right size. Now the 
converting part I know, 'cause I've been doing it a long time... ex:

mogrify -format png *.jpg
mogrify -format png *.gif
mogrify -format png *.tif
mogrify -scale x160 "*.png"
mv -f *.png /home/bruce/Desktop/bpics
rm -rf *.tif *.jpg *.gif *.TIF *.JPG *.GIF

So can some one help me out with a command/script/regex to find, mv, and the 
convert these images which are to large? The too large images are all large 
than 160 dpi, but of various sizes.

PS. You get extract points if you can add a piece to my above script that 
would limit the kb's. I want to limit the physcial size to 150 kilobytes or 
less

So if you can help, I'd greatly appreciate it.

-- 
Bruce Harding
Manager,
Computer Books for Less
RefurbComputers.ca
1642 Merivale Rd. (Merivale Mall)
Ottawa ON   K2G 4A1
Phone: 613-224-0135
Fax: 613-224-0683

replies