verot / class.upload.php

This PHP class uploads files and manipulates images very easily. It is in fact as much as an image processing class than it is an upload class. Compatible with PHP 4, 5, 7 and 8. Supports processing of local files, uploaded files, files sent through XMLHttpRequest.
http://www.verot.net/php_class_upload.htm
GNU General Public License v2.0
853 stars 359 forks source link

image resize not work #155

Closed guraysatici closed 2 years ago

guraysatici commented 2 years ago

Hi, i trying this php code but it's not working to image resize code.. im trying this code :

include("./incs/class.upload.php");
$handle = new \Verot\Upload\Upload($_FILES['Filedata']);
   if ($handle->uploaded) {
    $handle->file_new_name_body = $fileName;
    $handle->process($target);
          $imageOrg = $handle->file_dst_pathname;
    if ($handle->processed) {
        $handle->file_new_name_body = $fileName;
        $handle->file_name_body_pre = 'm_';
        $handle->image_resize = true;
        $handle->image_x = 400;
        $handle->image_ratio_y = true;
        $handle->process($target);
              $imageMdm = $handle->file_dst_pathname;
              if ($handle->processed) {
verot commented 2 years ago

Check the logs produced by the class

aramis-it commented 2 years ago

I have same problem. Nor errors. Precrop and resize not working

$handle->image_precrop = $crop;
                foreach ($sizes as $key => $size) {
                    $handle->image_resize = true;
                    $handle->image_ratio_y = true;
                    $handle->file_overwrite = true;
                    $handle->file_new_name_body = $option->name;
                    $handle->file_name_body_pre = $size;
                    $handle->image_x = $size;
                    $handle->process($path);
                }

                if ($handle->processed) {
                    $handle->clean();
guraysatici commented 2 years ago

I have same problem. Nor errors. Precrop and resize not working

$handle->image_precrop = $crop;
                foreach ($sizes as $key => $size) {
                    $handle->image_resize = true;
                    $handle->image_ratio_y = true;
                    $handle->file_overwrite = true;
                    $handle->file_new_name_body = $option->name;
                    $handle->file_name_body_pre = $size;
                    $handle->image_x = $size;
                    $handle->process($path);
                }

                if ($handle->processed) {
                    $handle->clean();

Hi, Please check that the GD library loaded... it was resolved after loadin the GD library..

aramis-it commented 2 years ago

I have same problem. Nor errors. Precrop and resize not working

$handle->image_precrop = $crop;
                foreach ($sizes as $key => $size) {
                    $handle->image_resize = true;
                    $handle->image_ratio_y = true;
                    $handle->file_overwrite = true;
                    $handle->file_new_name_body = $option->name;
                    $handle->file_name_body_pre = $size;
                    $handle->image_x = $size;
                    $handle->process($path);
                }

                if ($handle->processed) {
                    $handle->clean();

Hi, Please check that the GD library loaded... it was resolved after loadin the GD library..

Thank you. It works now :)