You are not logged in.

#1 2009-07-31 00:52:32

Renan Birck
Member
From: Brazil
Registered: 2007-11-11
Posts: 401
Website

Search images by resolution?

Hello,

I have a folder full of images I use as wallpapers. Now I need to sort them into widescreen and non-widescreen.

Is there some command-line app like 'find' that can search images and return all the ones which have a certain resolution/aspect ratio?

Thanks!

Offline

#2 2009-07-31 01:09:30

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: Search images by resolution?

Maybe you should look into exiftool. It should, in combination with commandline magic, should be able to do what you need, I think.

Offline

#3 2009-07-31 07:24:56

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: Search images by resolution?

Renan Birck wrote:

Hello,

I have a folder full of images I use as wallpapers. Now I need to sort them into widescreen and non-widescreen.

Is there some command-line app like 'find' that can search images and return all the ones which have a certain resolution/aspect ratio?

Thanks!

You can try identify command, brought by the imagemagick package: http://www.imagemagick.org/script/identify.php

Last edited by RaisedFist (2009-07-31 07:29:10)

Offline

#4 2009-07-31 10:42:22

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: Search images by resolution?

Oh, good idea, just tried!

That's enough for me, as I didn't really many different resolutions (and those are important enough, too)...:

for pic in $(ls *jpg); do echo mv \"$pic\" \"$(identify $pic | sed "s/$pic [^ ]* \([^ ]*\) .*/.\/\1\_$pic/")\"; done;

(I hate it: Need to set IFS to \n if file names contain white-spaces)

Offline

#5 2009-07-31 16:23:40

Renan Birck
Member
From: Brazil
Registered: 2007-11-11
Posts: 401
Website

Re: Search images by resolution?

whoops wrote:

Oh, good idea, just tried!

That's enough for me, as I didn't really many different resolutions (and those are important enough, too)...:

for pic in $(ls *jpg); do echo mv \"$pic\" \"$(identify $pic | sed "s/$pic [^ ]* \([^ ]*\) .*/.\/\1\_$pic/")\"; done;

(I hate it: Need to set IFS to \n if file names contain white-spaces)

This, together with a few 'mv' commands, did it. Thanks smile

Offline

Board footer

Powered by FluxBB