noelyahan / mergi

go library for image programming (merge, crop, resize, watermark, animate, ease, transit)
http://mergi.io/
MIT License
233 stars 27 forks source link

Any possible to support self-adaption proportional width or height ? #9

Open ycrao opened 4 years ago

ycrao commented 4 years ago

In some case, need resize image to fixed width with proportional height, or fixed height with proportional width.

mergi \
-i "https://cdn.pixabay.com/photo/2015/03/26/09/54/pug-690566_960_720.jpg" \
-r "250 fit"

image

noelyahan commented 4 years ago

@ycrao this seems a useful feature and possible thing to add btw just to be clear, as an example if the image width,height (1000, 500) and the fixed width is 250 the proportional height should be 500