LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Batch image dimension detection and deletion (https://www.linuxquestions.org/questions/linux-software-2/batch-image-dimension-detection-and-deletion-302605/)

macskeeball 03-17-2005 12:05 AM

Batch image dimension detection and deletion
 
I have a folder full of many desktop pictures (aka wallpaper). They're pretty nice, but this Saturday we'll be buying a laptop which happens to be widescreen. All of our desktop pictures have the standard 4/3 aspect ratio and some of these pictures (1024x728, etc.) will simply lack the width necessary to fill the screen without streching.

Since I have so many desktop pictures, it would be great if there was a way to automatically delete all images in this folder (~/Pictures/Desktop Pictures) that are less than 1280 pixels wide or less than 854 pixels tall. How could I go about doing this?

titopoquito 03-17-2005 03:54 AM

Not the whole solution, but maybe it helps:
If you have imagemagick and the tcsh installed, you could use the "identify" command to give out the dimensions of each wallpaper and give out only the name and the dimension. It's a raw hack, there are surely better solutions for this.

Code:

foreach f (*)
  identify $f | awk '{ print $1 " " $3 }'
end

titopoquito


All times are GMT -5. The time now is 02:07 PM.