Resizing images using php

前端 未结 7 1874
慢半拍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:39

    If it's giving you problems, you can back door it. Instead of letting the class calculate the ratios, go straight to the resize function.

         $image = new SimpleImage();
         $image->load($_FILES['uploaded_image']['tmp_name']);     
         $image->resize(300, 300);
         $image->save('./images/photo'.$id.'.jpg');
         header("Location: people.php");
         exit; 
    

提交回复
热议问题