Buenas Tardes soy nuevo en esto pero estoy desesperado al momento de subir una pagina me muestra este error:
Fatal error: Out of memory (allocated 26214400) (tried to allocate 11264 bytes) in /home/umiedu/public_html/CapturaNoticias/libreriagraficaphp.php on line 49
esa linea que marca el error es referente a esta funcion:
function thumbnail($image_path,$thumb_path,$image_name,$thu mb_width)
{
$src_img = imagecreatefromjpeg("$image_path/$image_name");
$origw=imagesx($src_img);
$origh=imagesy($src_img);
//Nuevo
if ( $origw <= $thumb_width && $origh <= $thumb_width )
{ //Si la foto es mas pequeña que la dimension dada, queda igual
$new_w = $origw;
$new_h = $origh;
}
else
{ //Si la Foto es mas grande, escala con el valor de la dimension dada como maximo
$k = ( $origw >= $origh ) ? $origw / $thumb_width : $origh / $thumb_width;
$new_w = $origw/$k;
$new_h = $origh/$k;
}
//Nuevo
//-->$new_w = $thumb_width;
//$diff=$origw/$new_w;
//$new_h=$new_w;
//-->$new_h=round(($new_w*$origh)/$origw);
$dst_img = imagecreatetruecolor($new_w,$new_h);
// for($i=0; $i<256; $i+=2)
// imagecolorallocate($dst_img , $i, $i, $i);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_ w,$new_h,imagesx($src_img),imagesy($src_img));
imagejpeg($dst_img, "$thumb_path/$image_name");
return true;
}
NOTA: lo que esta señalado en rojo es donde me marka el error si alguien me puede aclara el problema se lo agradeseria mucho
que tengan Un buen dia