Foros del Web » Programando para Internet » PHP »

problemas con thum.php!!!

Estas en el tema de problemas con thum.php!!! en el foro de PHP en Foros del Web. Hola amigos del foro... Tengo un problema con este thum.php las imagenes que se cargan en mi galeria flash salen pixeliadas... datos de mi imagen: ...
  #1 (permalink)  
Antiguo 24/02/2005, 03:43
Avatar de jhhonn  
Fecha de Ingreso: octubre-2003
Ubicación: NY
Mensajes: 120
Antigüedad: 20 años, 5 meses
Puntos: 0
Exclamación problemas con thum.php!!!

Hola amigos del foro...

Tengo un problema con este thum.php
las imagenes que se cargan en mi galeria flash salen pixeliadas...

datos de mi imagen:
ancho 80px largo 105px
14KB
Color: 24
Resolución 200
*jpg

datos del thum.php:

<?php
function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(".",$name);
if (preg_match("/jpg|jpeg|JPG|JPEG/",$system[1])){$src_img=imagecreatefromjpeg($name);}
if (preg_match("/png|PNG/",$system[1])){$src_img=imagecreatefrompng($name);}
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==""){
$dst_img=ImageCreate($thumb_w,$thumb_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_ w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thum b_w,$thumb_h,$old_x,$old_y);
}
if (preg_match("/png/",$system[1])){
imagepng($dst_img,$filename);
} else {
//Calidad de imagen
Header("Content-type: image/jpeg");
imagejpeg($dst_img,"",125);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}

$dirs=explode("/",$foto);
$onlyfile=array_pop($dirs);
$path=implode("/",$dirs);
//chdir($path);
createthumb($onlyfile, $foto, "105", "105");
?>


estaré atento a sus ayudas... gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:42.