Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/09/2007, 18:01
Avatar de El_Metallick
El_Metallick
 
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago, Chile
Mensajes: 1.718
Antigüedad: 21 años, 5 meses
Puntos: 16
Re: Problemas al hacer thumbnail

GatorV efectivamente era eso le puse 50MB para probarlo y funciono a la perfección ahora mi duda es, como puedo hacer para que se me adecue a 8MB?, al final reduje el script a esto:

b.php
Código PHP:
<?php
    
function resize($img,$new_img,$new_width,$new_height,$quality)
    { 
    
$ext explode(".",$img);
    
$num count($ext) - 1;

    if((
$ext[$num] == "jpg") || ($ext[$num] == "jpeg"))
    {
        
$image ImageCreateFromJPEG($img);    
    }
    else if(
$ext[$num] == "gif")
    {
        
$image ImageCreateFromGIF($img);
    }
    else if(
$ext[$num] == "png")
    {
        
$image ImageCreateFromPNG($img);
    }
    else
    {
        echo 
"Error, extencion no permitida";
        die();
    } 
    
    
$thumbnail imagecreatetruecolor($new_width,$new_height); 

    
ImageCopyResized($thumbnail,$image,0,0,0,0,$new_width,$new_height,ImageSX($image),ImageSY($image)); 

    
ImageJPEG($thumbnail,$new_img,$quality);
    
ImageDestroy($image);
}
    
    
$stat $_GET['stat'];
    
$name $_FILES['file']['name'];
    
$dir "images/gallery/";
    
$extention explode(".",$name);
    
$num count($extention) - 1;
    
    
$name_thum 'thumbnail_'.$name;
    
$dir_thum "images/gallery/thumbnail/";
    
    if(
$name == "")
    {
        if(
stat == 1)
        {
?>
<p align="center">Error</p>
<?php
        
}
?>
<form action="b.php" method="post" enctype="multipart/form-data">
  <input name="file" type="file" size="51" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight: bold; border:0px solid;" /></td>
  <p align="center"><input type="submit" name="submit" value="Subir" /></p>
</form>
<?php    
    
}
    else
    {
        if(
$extention[$num] == "jpg")
        {
            if(@
move_uploaded_file($_FILES['file']['tmp_name'], $dir.$name))
            {
                
resize($dir.$name,$dir_thum.$name_thum,200,100,95);
?>
<br /><br /><img src="<?= $dir_thum.'thumbnail_'.$name ?>" />
<?php
            
}
            else
            {
                
header("Location: b.php?stat=1");
            }
        }
    }
?>
y me manda el mismo error y ya no se como reducir mas el script.

Saludos
__________________
Haz la guerra en la cama y el amor donde se te de la gana...
El tiempo es el mejor maestro, lo único malo es que te mata...¡¡Aprovecha tu tiempo!!