Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/02/2011, 13:39
kirst
 
Fecha de Ingreso: septiembre-2009
Mensajes: 230
Antigüedad: 17 años
Puntos: 2
Funcion de thumbnail a temporal

Quisiera hacer un thumbnail de las imagenes pero TEMPORALMENTE, no crearlas como esta en esta función, no se me ocurre como, ayuda?

Código PHP:
function createthumb($name,$file,$maxsize)
{
  
$maxsize += 8;
  list(
$width, $height) = getimagesize("$name/$file");
  
$width = min($width, $height);
  
$tn = imagecreatetruecolor($maxsize, $maxsize);
  
$image = imagecreatefromjpeg("$name/$file");
  
imagecopyresampled($tn, $image, 0, 0, 0, 0, $maxsize, $maxsize, $width, $width);
  if(!
is_dir("$name/thumbnails"))
  {
    
mkdir ("$name/thumbnails", 0777);
  }
  
imagejpeg($tn, "$name/thumbnails/tn_$file", 90);
  return 
true;
}