Batch resize/rename pictures

My camera uses file names like DSCF0000.JPG (upper case). This isn’t a problem on windows, but linux is case sensitive and I want lower case extensions. For this I open a terminal, go to the folder where I downloaded my pictures, and type:

for i in *; do j=`echo $i | cut -d . -f 1`; j=$j".jpg"; mv $i $j; done

To resize my images I use something like:

mogrify -resize 1024 -quality 70 *.jpg

You must have ImageMagick installed if you want to use mogrify. Mogrify replaces the original files, so take care when you use it!



%d bloggers like this: