'How to enlarge into PNG no less than a height of 2880, but proportions must be sustained and maintained?

My special requirements are,

  1. When their height is 2879 or below, enlarge into 2880
  2. When their height is 2881 or over, leave alone
  3. Always sustain and maintain their proportion
  4. Everything must be converted into PNG in a full quality, no matters if the source picture is PNG or JPG
  5. Those are my photographes to be enlarged for use as my own UEFI wallpapers on an 5k screen
  6. PNG source pictures to be overwritten by the results
  7. JPG source pictures to be removed after the final completion

Finally, i’m unsure if those below commands are correct for doing everything above,

for J in *.jpeg; do ls */*|grep jpeg|xargs -I $J mogrify $J -gemoetry x2880< -quality 100% $J.png; done
for j in *.jpg; do ls */*|grep jpg|xargs -I $j mogrify $j -gemoetry x2880< -quality 100% $j.png; done
for K in *.JPEG; do ls */*|grep JPEG|xargs -I $K mogrify $K -gemoetry x2880< -quality 100% $K.png; done
for k in *.JPG; do ls */*|grep JPG|xargs -I $k mogrify $k -gemoetry x2880< -quality 100% $k.png; done
find ./ -type f -iname "*.JPEG" -exec mogrify -format png -layers Dispose -gemoetry x2880< -quality 100% {} +
find ./ -type f -iname "*.JPG" -exec mogrify -format png -layers Dispose -gemoetry x2880< -quality 100% {} +
find ./ -type f -iname "*.jpeg" -exec mogrify -format png -layers Dispose -gemoetry x2880< -quality 100% {} +
find ./ -type f -iname "*.jpg" -exec mogrify -format png -layers Dispose -gemoetry x2880< -quality 100% {} +

Thanks answering anyway, i appreciate every people’s effort :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source