PHP ~ class.upload ratio resize image

某些鳥原因害我試了好久0rz.......

總之這樣寫他就會照你給的圖片長寬調整圖片大小

如果圖片比較高他會resize在你的高度內等比例縮放

如果圖片比較長他會resize在你的長度內等比例縮放

    $image = $_FILES['image'];
    $handle = new Upload($image);
    if ($handle->uploaded)
    {
        $destinationFolder = '../../img/tvwalls/';   
        $handle->file_dst_pathname = $destinationFolder;
        $handle->file_new_name_ext = 'png';
        $handle->file_new_name_body   = 'blabla';
        $handle->file_auto_rename = false;
        $handle->file_overwrite = true;
        $handle->image_resize = true;
        $handle->image_x = 640;
        $handle->image_y = 400;
        $handle->image_ratio = true;


        $handle->Process($destinationFolder);
    }
   

http://www.verot.net/php_class_upload_docs.htm

沒有留言: