Hi,
I'm trying to resize a pic with the Code pasted below and get following
Error, why, how to resize it correctly???
src:
http://www.rideon.ch/php/gallerytest...PG&x=100&y=100
Error: <br />
<b>Fatal error</b>: Allowed memory size of 8388608 bytes exhausted at
(null):0 (tried to allocate 9088 bytes) in
<b>/srv/www/htdocs/web2/html/php/gallerytest/resizePic.php</b> on line
<b>39</b><br />
Source:
<?php
header("Content-type: image/jpeg");
header("Content-Disposition: inline; filename=\"". $src . "");
if (isset($x))
$detail_max_x=$ x;
else
$detail_max_x = 300;
if (isset($y))
$detail_max_y=$ y;
else
$detail_max_y = 300;
$type = "jpg";
// Orginalbild
$pic=$src;
// Bilddaten feststellen
$size=getimages ize($pic);
$faktor_y=$size[0]/$detail_max_y;
$faktor_x=$size[1]/$detail_max_x;
$breite = $size[0];
$hohe = $size[1];
// Verkleinerungsf aktor / Vergrösserungsa faktor
if($faktor_y < $faktor_x)
{ $sfaktor = $faktor_x; }
else
{ $sfaktor = $faktor_y; }
$neueBreite=int val($size[0]/$sfaktor);
$neueHoehe=intv al($size[1]/$sfaktor);
//JPG ausgabe
$altesBild=Imag eCreateFromJPEG ($pic);
$neuesBild=Imag eCreate($neueBr eite,$neueHoehe );
ImageCopyResize d($neuesBild,$a ltesBild,0,0,0, 0,$neueBreite,$ neueHoehe,$brei te,$hohe);
//$info = getimagesize($n euesBild);
//$farbe_b = imagecoloralloc ate($neuesBild, 10,36,106);
//imagerectangle( $neuesBild,1,1, $info[0]-1,$info[1]-1,$farbe_b);
Imagejpeg($neue sBild);
?>
Thank you very much!!!!
--
roN
www.rideon.ch