Reply to Re: dose not want to process jpg files

Re: dose not want to process jpg files  new!
by guillermo velez, 4 years, 8 months ago
hello so first I want to say ty so much for this amazing class second well as I say in the title the class doesn't want to process a jpg file with the resize on i put the code bellow

$imagen = new Upload($rutaimg);// creamos una nueva instancia de la clase upload para la gestion de la imagen 
$imagen->image_resize = false;// ponemos a true que queremos hacer un rezise de la imagen 
//$imagen->image_x = 500; ponemos el valor x width de la imagen a 350px
//$imagen->image_y = 500; ponemos el valor y hight de la imagen a 300px
$imagen->Process('../imguploads');// procesamos la imagen y la guardamos en la carpeta que deseemos indicandolo '../imguploads/'

it gives to me a weird output and I don't understand why

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\PaginaWebPirotecniaGrupo\classes\class.upload.php on line 3608
Call Stack
# Time Memory Function Location
1 0.0011 402320 {main}( ) ...\informulas.php:0
2 0.0024 436856 insertinfo::upLoadFormulas( ) ...\informulas.php:21
3 0.0198 1143312 upload->process( ) ...\insertinfo.php:22


this is the code between the lines 3596 to 3617

if ($gd_version >= 2 && is_numeric($auto_rotate)) {
    if (!in_array($auto_rotate, array(0, 90, 180, 270))) $auto_rotate = 0;
    if ($auto_rotate != 0) {
        if ($auto_rotate == 90 || $auto_rotate == 270) {
            $tmp = $this->imagecreatenew($this->image_src_y, $this->image_src_x);
        } else {
            $tmp = $this->imagecreatenew($this->image_src_x, $this->image_src_y);
        }
        $this->log .= '- auto-rotate image : ' . $auto_rotate . '
';
        for ($x = 0; $x < $this->image_src_x; $x++) {
            for ($y = 0; $y < $this->image_src_y; $y++){
                if ($auto_rotate == 90) {
                    imagecopy($tmp, $image_dst, $y, $x, $x, $this->image_src_y - $y - 1, 1, 1);
                } else if ($auto_rotate == 180) {
                    imagecopy($tmp, $image_dst, $x, $y, $this->image_src_x - $x - 1, $this->image_src_y - $y - 1, 1, 1);
                } else if ($auto_rotate == 270) {
                    imagecopy($tmp, $image_dst, $y, $x, $this->image_src_x - $x - 1, $y, 1, 1);
                } else {
                    imagecopy($tmp, $image_dst, $x, $y, $x, $y, 1, 1);
                }
            }
        }

ty so much for the answer to any oneReply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important