Hola
bueno,
os comento:
estoy usando un cms de galería de fotos que usa flash, php y mysql, este:
http://pg.notacube.com/main.php
subes la imagen y te crea un thumb, con esta funcion, usa GD:
Código PHP:
function createThumb($image, $newname){
$size = getimagesize ($image);
$height = $size[1];
$width = $size[0];
if ($width > $height) {
$newwidth = 80;
$newheight = round(($height*80)/$width);
} else {
$newheight = 80;
$newwidth = round(($width*80)/$height);
}
$src = imagecreatefromjpeg("$image");
$im = imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($im,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($im, $newname,50);
imagedestroy($im);
}
la cuestion es que sólo coge archivos .jpg, y yo quiero subir un .swf,
y lo sube, pero claro, crea un thumb con extension .swf,
y me sale esta información, (auqnue el swf lo traga, y el thumb.swf lo crea, pero claro, un cuadrado negro):
Código PHP:
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/html/galeria/_admin/imagenes.php on line 20
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '../imagenes/transformaciones/prob12.swf' is not a valid JPEG file in /home/html/galeria/_admin/imagenes.php on line 20
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/html/galeria/_admin/imagenes.php on line 22
mmm...la cuestion es que, cómo puedo hacer para que, subiendo un archivo .swf, cree un thumb con extension .jpg? éste thumb sería un archivo corrupto, pero luego yo lo subiría correctamente, me entendeis?, lo que quiero es que al menos cree una ruta a un thumb .jpg...
entonces, se me ocurre: en caseropseudocódigo:
"si el archivo es .swf, o no es .jpg, el thumb que sea .jpg" ó, "el thumb, pase lo q pase, q sea .jpg"
a alguien se le ocurre algo?
muchísimas gracias