Tema: Margen negro
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/03/2012, 13:27
Avatar de Lautaro_eb
Lautaro_eb
 
Fecha de Ingreso: mayo-2010
Ubicación: Bariloche, Argentina
Mensajes: 284
Antigüedad: 13 años, 10 meses
Puntos: 24
Margen negro

Cree un sistema de tumbails el problema esque este cuando sube la foto me crea un margen negro en la parte inferior y no pone la imagen por completo si me podrian ayudar a encontrar el problema se los agradeseria.

Código PHP:
Ver original
  1. function createFrom(){
  2.         if($this->ext == "jpg"  || $this->ext == "jpeg"){
  3.             return ImageCreateFromJPEG($this->image);
  4.         }else if($this->ext == "gif"){
  5.             return ImageCreateFromGIF($this->image);
  6.         }else if($this->ext == "png"){
  7.             return ImageCreateFromPNG($this->image);
  8.         }
  9.         return false;
  10.     }
  11. function resize($nwidth,$nheight = false){
  12. //     $rname = $this->dir."r".microtime(true).".png";
  13.         $rname = sprintf("%sr%d.png",$this->dit,microtime(true));
  14.         $image = $this->createFrom();        
  15.         //var_dump($image);
  16.         $height = imagesx($image);      
  17.         $width = imagesy($image);
  18.        
  19.         if(!$nheight){
  20.             $nwidth = $nwidth;
  21.             $nheight = round($height % $nwidth);
  22.         }
  23.         $thumb = imagecreatetruecolor($nwidth, $nheight);        
  24.         imagecopyresized($thumb,$image,0,0,0,0,$nwidth,$nheight,$width,$height);
  25.         sleep(3);
  26.         unset($image);      
  27.         imagePNG($thumb,$rname);        
  28.         return $rname;
  29.     }
__________________
Mi emprendimiento: Software BRC
Youtube: Tutoriales de programación y electrónica.