Make sure to cd
into the directory with subfolders containing photos, for example:
#> λ ~/ cd Desktop/test
#> λ ~/Desktop/test/ ls
#> 100003 100004
Where 100003 and 100004 are folders that contain photos. If the folders don't exist and you need to rename photos based on the file name, see this unix solution or this windows solution.
Next, run the following command to explicitly limit the image to being, at most, 240x240 pixels:
find . -name '*.jpg' -execdir mogrify -resize "240x240>" {} \;
That's it! This converts a 3036 × 4048 image to 180 × 240 and a 4048 × 3036 to 240 × 180.
Sources:
- Limit image size
- Rename images in windows
- Rename images in unix... cant remember :/