Hallo,
folgendes Script erzeugt den folgenden Fehler:
Fehler:
Fatal error: Out of memory (allocated 30670848) (tried to allocate 12288 bytes) in /homepages/test.php on line 16
Script:
Das zeigt mit 80M an..
folgendes Script erzeugt den folgenden Fehler:
Fehler:
Fatal error: Out of memory (allocated 30670848) (tried to allocate 12288 bytes) in /homepages/test.php on line 16
Script:
PHP:
function resize_image($image,$max_width,$max_height){
//First of all..grab some image infos
$picinfos=getimagesize($image);
//Create an new image from the old one
$oldpic=ImageCreateFromJPEG($image);
//Check which site is bigger, and calculate the factor to resize
if($picinfos[0]>$picinfos[1]){
$fator=$max_width / $picinfos[0];
}else{
$factor=$max_height / $picinfos[1];
}
//calculate new sizes
$new_width=$picinfos[0] * $factor;
$new_height=$picinfos[1] * $factor;
//Create an new blank image with new sizes
$newpic=imagecreate($new_width,$new_height);
//Copy resized old pic into new pic
ImageCopyResized($newpic,$oldpic,0,0,0,0,$new_width,$new_height,$picinfos[0],$picinfos[1]);
//now you can save it, with ImageJPEG($newpic,"directory/to/save/in");
}
resize_image("upload/bilder/922180.jpg",800,400);
PHP:
$y=ini_get("memory_limit");
echo $y;