Zitat:
Zitat von netspy
Kannst du mal den relevanten Code mit imagejpeg() posten, wo der Fehler auftritt?
Mario
|
Hi Mario,
ich nehme an Du meinst die Stelle aus dem Code:
Code:
function mach_thumb($file, $save, $width, $height)
{
$infos = @getimagesize($file);
$iWidth = $infos[0];
$iHeight = $infos[1];
$iRatioW = $width / $iWidth;
$iRatioH = $height / $iHeight;
if($iRatioW < $iRatioH)
{
$iNewW = $iWidth * $iRatioW;
$iNewH = $iHeight * $iRatioW;
}
else
{
$iNewW = $iWidth * $iRatioH;
$iNewH = $iHeight * $iRatioH;
}
if($infos[2] == 1) {$imgA = imagecreatefromgif($file);}
elseif($infos[2] == 2) {$imgA = imagecreatefromjpeg($file);}
elseif($infos[2] == 3) {$imgA = imagecreatefrompng($file);}
else {return false;}
if(!$imgA) {return false;}
$imgB = @imagecreatetruecolor($iNewW, $iNewH);
@imagecopyresampled($imgB, $imgA, 0, 0, 0, 0, $iNewW, $iNewH, $infos[0], $infos[1]);
if(!$imgB) {return false;}
if ($infos[2] == 1) {imagegif($imgB, $save);}
if ($infos[2] == 2) {imagejpeg($imgB, $save);}
if ($infos[2] == 3) {imagepng($imgB, $save);}
return;
}
Grüße.
SPMan