Yüklenen resmin dışında bir resmini oluşturan bir komut dosyası var. Bu jpgs ile çalışıyor, ama bana bir hata veriyor
Ölümcül hata: tükenmiş 67108864 bayt İzin bellek boyutu (26250000 bayt ayırmaya çalıştı)
Ben bir png resim upload.
Script:
//create thumbnail; $modwidth and height are calculated in another part of the script
//$original is the path to the full sized image
$tn = imagecreatetruecolor($modwidth, $modheight);
switch (strrchr($new_image_name,'.')) {
case ".jpg":
$image = imagecreatefromjpeg($original);
break;
case ".jpeg":
$image = imagecreatefromjpeg($original);
break;
case ".png":
$image = imagecreatefrompng($original);
break;
case ".gif":
$image = imagecreatefromgif($original);
break;
}
imagecopyresampled($tn, $image, 0, 0, $x_pos, $y_pos, $modwidth, $modheight, $width, $height);
switch (strrchr($new_image_name,'.')) {
case ".jpg":
imagejpeg($tn, $target_path, 100);
break;
case ".jpeg":
imagejpeg($tn, $target_path, 100);
break;
case ".png":
imagepng($tn, $target_path, 0);
break;
case ".gif":
imagegif($tn, $target_path);
break;
}
As I said it works perfectly with JPGs and also with GIFs. That memory error appears only with PNGs, and I have only used a 1.2Mb image.
How can i solve this? thanks Patrick