#!/bin/bash
cd public/assets/Uploads
echo "Updating JPG"
identify -format '%w %h %i\n' ./*.JPG |
awk '$1 > 400 || $2 > 400 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '2400' -quality 80
echo "Updating jpg"
identify -format '%w %h %i\n' ./*.jpg |
awk '$1 > 400 || $2 > 400 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '2400' -quality 80
echo "Updating PNG"
identify -format '%w %h %i\n' ./*.png |
awk '$1 > 400 || $2 > 400 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '2400' -quality 80
