Ver Mensaje Individual
  #8 (permalink)  
Antiguo 31/03/2009, 03:15
Avatar de Freakme
Freakme
 
Fecha de Ingreso: julio-2007
Ubicación: Portugalete
Mensajes: 97
Antigüedad: 16 años, 9 meses
Puntos: 0
Respuesta: Problema para crear Thumbnails

No me funciona ninguno de vuestros códigos...
Podriaís poner algún ejemplo en el que los hayais usado, llevo 3 días con eso y esto un poco frustrado...
A ver si es que me estoy equivocando en algo, yo doy por supuesto que con estos códigos se crea un archivo de imagen que se guarda en la carpeta que le ponga, ¿verdad?
Gracias.

Edito:
He dado con un código que me funciona cuando lo uso en localhost, pero lo subo al servidor y no funciona. Este es el código:

Código:
<?php
// The file you are resizing
$file = 'miimagen.jpg';

//This will set our output to 45% of the original size
$size = 0.45;

// This sets it to a .jpg, but you can change this to png or gif
header('Content-type: image/jpeg');

// Setting the resize parameters
list($width, $height) = getimagesize($file);
$modwidth = $width * $size;
$modheight = $height * $size;

// Resizing the Image
$tn = imagecreatetruecolor($modwidth, $modheight);
$image = imagecreatefromjpeg($file);
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);

// Outputting a .jpg, you can make this gif or png if you want
//notice we set the quality (third value) to 100
$save="mini_$file";
imagejpeg($tn, $save, 100);
?>
He mirado el phpinfo y tengo activada la librería GD en el servidor... ¿¿alguna idea??

Última edición por Freakme; 31/03/2009 a las 04:12