Foros del Web » Programando para Internet » PHP »

Error fatal

Estas en el tema de Error fatal en el foro de PHP en Foros del Web. Hola a todos acabo de combiar el server de la pagina web donde trabajo yo todo esta funcionando menos la parte donde se agregan imagenes ...
  #1 (permalink)  
Antiguo 11/09/2007, 08:51
 
Fecha de Ingreso: octubre-2006
Mensajes: 32
Antigüedad: 17 años, 6 meses
Puntos: 2
Error fatal

Hola a todos acabo de combiar el server de la pagina web donde trabajo yo todo esta funcionando menos la parte donde se agregan imagenes alas notificas cuando agrego la imagen me dice me dice:

Filename: soporte.jpg has been uploaded
Create thumb-nail image...

Fatal error: Call to undefined function: imagecreatefromjpeg() in c:\program files\easyphp1-8\www\admin\photos\upload.php on line 36

Linea 36 me dice if (preg_match("/jpg|jpeg/",$system[1])){$src_img=imagecreatefromjpeg($name);}

que forma parte de la funcion

Cita:
function createthumb($name,$filename,$new_w,$new_h)
{
$system=explode(".",$name);
if (preg_match("/jpg|jpeg/",$system[1])){$src_img=imagecreatefromjpeg($name);}
if (preg_match("/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;
}
$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
{
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
if(!imagedestroy($src_img))
{
// delete created files
$return = @unlink($filename);
$return2 = @unlink($name);
// Return FALSE if not found
var_dump($return);
var_dump($return2);
?><script>alert("Woops! Please try a different photo, or file perms for uploads,small_thumbs,thumbs dir, set to 0777");window.location = "index.php";</script><?
}

}

Gracias

Última edición por fernandofgs90; 11/09/2007 a las 09:05
  #2 (permalink)  
Antiguo 11/09/2007, 08:59
Avatar de andruqui  
Fecha de Ingreso: agosto-2007
Mensajes: 269
Antigüedad: 16 años, 8 meses
Puntos: 2
Re: Error fatal

Editado ....
  #3 (permalink)  
Antiguo 11/09/2007, 09:04
 
Fecha de Ingreso: octubre-2006
Mensajes: 32
Antigüedad: 17 años, 6 meses
Puntos: 2
Re: Error fatal

Cita:
Iniciado por andruqui Ver Mensaje
Editado ....
??????? que edite que el codigo???No se que me quiciste decir
  #4 (permalink)  
Antiguo 11/09/2007, 09:31
Avatar de Seppo  
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
Re: Error fatal

Lo que te dice es que no está definida la función "imagecreatefromjpeg", lo que parece ser que no está disponible la librería GD.
Fijate si podés cambiar la configuración del servidor, en el php.ini si la línea extension=php_gd2.dll tiene un ";" antes, quitalo y reiniciá el servidor APACHE
  #5 (permalink)  
Antiguo 11/09/2007, 09:59
 
Fecha de Ingreso: octubre-2006
Mensajes: 32
Antigüedad: 17 años, 6 meses
Puntos: 2
Re: Error fatal

SOS GRANNNNNNNNNDE AMIGO voy a fijarme Gracias
  #6 (permalink)  
Antiguo 11/09/2007, 11:00
 
Fecha de Ingreso: octubre-2006
Mensajes: 32
Antigüedad: 17 años, 6 meses
Puntos: 2
Re: Error fatal

Eso mismo era muchas gracias
  #7 (permalink)  
Antiguo 11/09/2007, 11:42
Avatar de andruqui  
Fecha de Ingreso: agosto-2007
Mensajes: 269
Antigüedad: 16 años, 8 meses
Puntos: 2
Re: Error fatal

Eso es lo que habia puesto, luego quise editar para agregar info y no pude volver al msg original.
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 16:51.