php resize image on upload

后端 未结 12 1469
别跟我提以往
别跟我提以往 2020-11-27 04:09

I got a form where the user is inserting some data and also uploading an image.

To deal with the image, I got the following code:

define(\"MAX_SIZE\"         


        
12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 04:17

    Download library file Zebra_Image.php belo link

    https://drive.google.com/file/d/0Bx-7K3oajNTRV1I2UzYySGZFd3M/view

    resizeimage.php

    source_path = $target_file1;
        $ext = $photo;
        // indicate a target image
        $resize_image->target_path = 'images/thumbnil/' . $ext;
        // resize
        // and if there is an error, show the error message
        if (!$resize_image->resize(200, 200, ZEBRA_IMAGE_NOT_BOXED, -1));
        // from this moment on, work on the resized image
        $resize_image->source_path = 'images/thumbnil/' . $ext;
    ?>
    

提交回复
热议问题