Einzelnen Beitrag anzeigen
  #9 (permalink)  
Alt 15.12.2006, 23:52
Benutzerbild von SPMan
SPMan SPMan ist offline
The Oncoming Storm
XHTMLforum-Kenner
Thread-Ersteller
 
Registriert seit: 23.05.2004
Ort: Metropolis
Beiträge: 1.243
SPMan wird schon bald berühmt werden
Standard

Zitat:
Zitat von netspy Beitrag anzeigen
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
__________________
"Glück entsteht oft durch Aufmerksamkeit in kleinen Dingen."
- Wilhelm Busch
Mit Zitat antworten
Sponsored Links