Hallo, im Anhang findet ihr 2 PNG-Bilder!
Wenn ich mit diesem Code:
das PNG "test-ok.png" lade, bekomm ich das das Bild ausgegeben,
wenn ich "test-err.png" lade, bekomm ich folgenden Fehler:
Der Internet-Explorer hat auch ein Problem mit dem Anzeigen des "test-err.png" wobei "test-ok.png" geht!
Komisch das normale Grafikprogramme wie IrvanView das kaputte ohne Probleme lese kann!
Die beiden PNGs werden mit der gleichen Routine erstellt, aber irgendwas ist bei dem einen kaputt! Ich würde das Problem jetzt nicht auf PHP schieben, sonder mich würde interessieren was an dem einen PNG anders ist als bei dem Anderen!
Kann mir jemand helfen?
Danke
PS. Das Problem seht ihr hier auch schon im Browser von php.de. Das erste PNG bekommt eine Vorschau, das andere nicht!
Wenn ich mit diesem Code:
PHP-Code:
header('Content-Type: image/png', true);
ImagePNG(ImageCreateFromPNG('test-ok.png')); // Geht!
ImagePNG(ImageCreateFromPNG('test-err.png')); // Geht NICHT!
wenn ich "test-err.png" lade, bekomm ich folgenden Fehler:
<b>Warning</b>: imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagec reatefrompng</a>]: gd-png: fatal libpng error: Read Error: truncated data in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>: imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagec reatefrompng</a>]: gd-png error: setjmp returns error condition in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>: imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagec reatefrompng</a>]: 'test-err.png' is not a valid PNG file in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>: imagepng() expects parameter 1 to be resource, boolean given in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>: imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagec reatefrompng</a>]: gd-png error: setjmp returns error condition in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>: imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagec reatefrompng</a>]: 'test-err.png' is not a valid PNG file in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>: imagepng() expects parameter 1 to be resource, boolean given in <b>D:\Websites\!Tests\png.php</b> on line <b>113</b><br />
Komisch das normale Grafikprogramme wie IrvanView das kaputte ohne Probleme lese kann!
Die beiden PNGs werden mit der gleichen Routine erstellt, aber irgendwas ist bei dem einen kaputt! Ich würde das Problem jetzt nicht auf PHP schieben, sonder mich würde interessieren was an dem einen PNG anders ist als bei dem Anderen!
Kann mir jemand helfen?
Danke
PS. Das Problem seht ihr hier auch schon im Browser von php.de. Das erste PNG bekommt eine Vorschau, das andere nicht!
Kommentar