Resizing images using php

前端 未结 7 1871
慢半拍i
慢半拍i 2021-02-10 16:17

I\'m using a neat little php script to resize my images to fit in a 300x300 pixel square, while keeping the aspect ratio. I got the script from here.

Here is the whole s

7条回答
  •  太阳男子
    2021-02-10 16:54

    You can make use of the imagescale() available from PHP 5.5.0 to simplify your process of re-sizing/scaling images.

    Such that...

    $imgresource = imagecreatefromjpeg("pathtoyourimage.jpg");
    imagescale($imgresource, 500, 900, IMG_BICUBIC);
    

提交回复
热议问题