Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/09/2010, 12:42
Avatar de RIVERMILLOS
RIVERMILLOS
 
Fecha de Ingreso: marzo-2010
Mensajes: 1.336
Antigüedad: 14 años, 2 meses
Puntos: 15
Respuesta: Pregunta sobre thumbails

pero si las redusco , las fotos que tengan mas alto que ancho se van a ver mal y lo mismo para las que tengan mas ancho que alto , poreso no las redimenciono a la misma yo lo estoy haciendo asi:

Código:
function generarThumbnail($file,$width){
$this->file=$file;
$this->original = imagecreatefromjpeg("../View/galeria/".$file.".jpg");
$this->ancho = imagesx( $this->original );
$this->alto = imagesy( $this->original );
$new_width = $width;
$new_height = floor( $this->alto * ( $width / $this->ancho ) );
$this->thumb = imagecreatetruecolor( $new_width, $new_height );
imagecopyresized( $this->thumb, $this->original, 0, 0, 0, 0, $new_width, $new_height, $this->ancho, $this->alto );
imagejpeg($this->thumb,'../View/galeria/thumbs/'.$this->file.'_thumb.jpg',100); 
return $this->file.'_thumb.jpg';	
}
pero asi no me quedan todas iguales que puedo hacer?

saludos