I'm trying to resize all images in a directory and sub directories. I have this script which I got from here: Use mogrify to resize large files while ignoring small ones
and adjusted to:
identify -format '%w %h %i\n' ./*.jpg |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'
but it only does the current directory and only .jpg extensions - ignores the upper case - .JPG
I've tried making adjustments but not making much progress.
find: `identify': No such file or directory
– mmc501 Aug 15 '17 at 10:53identify
andmogrify
to see if you getcommand not found
, in which case there is a problem with your imagemagick install. – sebasth Aug 15 '17 at 11:24mogrify -resize 50% 1test.jpg
andmagick mogrify -resize 50% 1test.jpg
First one said mogrify can be found on one of following packages and other one said no command 'magick' found. It was installed via https://serverpilot.io/community/articles/how-to-install-the-php-imagemagick-extension.html – mmc501 Aug 15 '17 at 11:34