Content-type: image/png - Datei kann nicht angezeigt werden ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Content-type: image/png - Datei kann nicht angezeigt werden ...

    Hallo,

    ich bin schon den ganzen tag dabei rauszufinden, was da nicht klappen will... ich habe schon sämltliche foren durchforstet und nichts gescheites gefunden.

    GD library version 2.0 ist drauf und alles ist enabled....

    vielleicht weiß einer von euch, wo der fehler ist.

    hier der quelltext ArtikelImg.php :

    PHP Code:
    <?PHP

    header
    ("Content-type: image/png");

    $picture    $_GET['bild'];
    $top        $_GET['top'];
    $left        $_GET['links'];
    $width        $_GET['width'];
    $color        $_GET['color'];
    $z1            $_GET['z1'];
    $z2            $_GET['z2'];
    $z3            $_GET['z3'];

    $text1 "TextNo1";
    $text2 "TextNo2";
    $text3 "TextNo3";

    $width_total getimagesize("http//www.marcokruger.de/blueprint/pics/".$picture);

    $topfirst $top+12;
    $topsecond $topfirst+16;
    $topthird $topsecond+16;

    $Grafikdatei "http//www.marcokruger.de/blueprint/pics/".$picture;

    $im ImageCreateFromPNG($Grafikdatei);
    $color == 'black' $color ImageColorAllocate ($im000) : $color ImageColorAllocate ($im255255255);

    function 
    TextBreite($texthöhe,$fontfile,$textzeile) { 
            
    $ts imagettfbbox($texthöhe,0,$fontfile,$textzeile); 
            
    $ts_diff $ts[2] - $ts[0]; // x2 - x1; 
            
    return $ts_diff
    }


    function 
    MZT($texthöhe,$fontfile,$textzeile,$farbe,$top,$left,$width) { 

        global 
    $im
        
    $TS imagettfbbox($texthöhe,0,$fontfile,$textzeile); 
        
    $dx abs ($TS[2]-$TS[0]); 
        
    $dy abs ($TS[5]-$TS[3]); 
        
    $x = ((($left*2)+$width) - $dx )/2
        
    //$y = ($top - $dy ) + $dy; 
        
    ImageTTFText($im$texthöhe0$x$top$farbe$fontfile$textzeile); 



    if(
    $z1){

        
    $laenge1 TextBreite(12,"arial.ttf",$text1);
        while(
    $laenge1 >= $width){

            
    $text1 substr($text1,0,-1);
            
    $laenge1 TextBreite(12,"arial.ttf",$text1);
        }

        
    MZT (12,"arial.ttf",$text1,$color,$topfirst,$left,$width);
    }

    if(
    $z2){

        
    $laenge2 TextBreite(12,"arial.ttf",$text2);
        while(
    $laenge2 >= $width){

            
    $text2 substr($text2,0,-1);
            
    $laenge2 TextBreite(12,"arial.ttf",$text2);
        }

        
    MZT (12,"arial.ttf",$text2,$color,$topsecond,$left,$width);
    }

    if(
    $z3){

        
    $laenge3 TextBreite(12,"arial.ttf",$text3);
        while(
    $laenge3 >= $width){

            
    $text3 substr($text3,0,-1);
            
    $laenge3 TextBreite(12,"arial.ttf",$text3);
        }

        
    MZT (12,"arial.ttf",$text3,$color,$topthird,$left,$width);
    }

    ImageLine ($im$left$top$left$top+42$color);                    //linke Begrenzungsline
    ImageLine ($im$left+$width$top$left+$width$top+42$color);        //rechte Begrenzungslinie


    ImagePNG ($im);
    ImageDestroy ($im);
    ?>
    hier findet die ausgabe statt:

    PHP Code:
    if($text1 || $text2 || $text3){

                echo 
    "<div id='thumb_text1' style=\"top:0px; left:0px; filter:DropShadow(color=#CCCCCC, offx=2, offy=2)\">";
                echo 
    "<table width='256' height='100%' border='0' align='left' cellspacing='0' cellpadding='0'>";
                echo 
    "<TR>";
                    echo 
    "<TD colspan='3'>";
                        echo 
    "<img src='artikelImg.php?sid=$sid&seite=$picture&bild=$pic&artikel=$art&client=$client' border='0'>";
                    echo 
    "</TD>";
                echo 
    "</TR>";
                echo 
    "</TABLE>";
            } 
    das ganze wird in einem shirtcreator benutzt, wo man 3 zeilen text eingeben kann...

    der fehler lautet:

    Die datei kann nicht angezeigt werden, da sie fehler enthält ...

    Ich hoffe mir kann jemand helfen ..

    Grüße,
    Marco

  • #2
    umbrich bitte deinen code, kommentier die zeile aus, in der der header gesendet wird, stell dein error_reporting auf E_ALL und poste die richtigen fehlermeldungen.
    Die Zeit hat ihre Kinder längst gefressen

    Comment

    Working...
    X