Resize/crop/pad a picture to a fixed size

前端 未结 11 1806
孤城傲影
孤城傲影 2020-11-27 14:58

I need to resize a picture to a fixed size. But it has to keep the factors between the width and height.

Say I want to resize a picture from 238 (w) X 182 (

11条回答
  •  天命终不由人
    2020-11-27 15:48

    Do you have Imagick? If so you can load the image with it and do something like thumbnailimage()

    There you can skip either of the parameters (height or width) and it will resize correctly.

提交回复
热议问题