I need to convert a very large number of images JPEGs. those images some are 720px × 480px, and some 300x400 and some 2000x1400 and some are 1000x1000 etc.. I only need to resize those images to 1000x1000 without touch the images that have 1000x1000
here i try to make small script which is calculate the total size of each image w x h but i need to add if statement on it which is convert all images to 1000x1000 and exclude images that have 1000x1000 size
for image in *.jpg; do
IFS=x
read w h < <(identify "$image" | grep -oP '\d+x\d+(?=\+)')
echo $((w*h)) "$image"
done