-   Linux - Desktop (
-   -   Script to find wallpaper images (

1veedo 06-20-2010 07:12 PM

Script to find wallpaper images
So I have thousands of wallpapers scattered around my harddrive. Is there any way to scan for images with certain dimensions, ie your screen resolution?

frandalla 06-21-2010 12:31 AM

try the script below.
See the comments in the script for usage and dependencies.
tested on slackware 13.1

#Script By Francisco Dalla Rosa Soares - 2010/06/21
#USAGE: <directory to search> <what to search>
#EXAMPLE: /home/myuser *.jpg
#The script will return the path to the files that meet the image dimensions specified.
#Image dimensions are in the array WALLPAPERSIZE.
#You can add or remove sizes as you want.
#This script DEPENDS on exiv2 for checking image dimensions

WALLPAPERSIZE=( 800x600 1024x768 1200x600 1680x1050 1920x1200 1280x800 1600x1200 1280x1024 )
for i in $(find $1 -iname $2); do
FILENAME=`exiv2 $i 2>/dev/null | grep "name" | awk -F: '{print $2}'`;
IMAGESIZE=`exiv2 $i 2>/dev/null | grep "Image size" | awk -F: '{print $2}'| sed 's/ //g'`;
for j in ${WALLPAPERSIZE[@]}; do
if [ $j == $IMAGESIZE ]

1veedo 06-21-2010 10:10 AM

Awesome, that's exactly what I was looking for!

All times are GMT -5. The time now is 06:55 PM.