#19418 [NEW]: ImagePNG() error

From: Date: Sun, 15 Sep 2002 17:58:13 +0000
Subject: #19418 [NEW]: ImagePNG() error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19404@lists.php.net to get a copy of this message
From:             sprice@wisc.edu
Operating system: Darwin (Mac OS X)
PHP version:      4.2.3
PHP Bug Type:     GD related
Bug description:  ImagePNG() error

Here is the script that I am trying to run:
<?php
header( "Content-type: image/png" );
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Cache-Control: no-store, no-cache, must-revalidate" );
header( "Pragma: no-cache" );


$medimg = $_SERVER['DOCUMENT_ROOT'] .
"/riverdata/images/world_map_med.gd2";
$img = ImageCreateFromGD2Part( $medimg, 1, 1, 800, 600 );

//Send it out.
ImagePNG( $img );
ImageDestroy( $img );

?>

When I load this script from the browser Chimera, it fails with the error
"The image “http://144.92.10.251/riverdata/test.php”
cannot be displayed,
because it contains errors."

When I load this script from the browser OmniWeb, it fails with this error
"Cannot Load Address; Attempted read off end of buffer"

I tried changing "ImagePNG( $img );" to "ImageJPEG( $img );" and the
content-type header to jpeg, and then it works.

ImagePNG() works in the rest of my scripts, which leads me to believe that
it may be a problem with the data recieved from ImageCreateFromGD2Part().

If you want a .gd2 image for testing, you can use
"http://144.92.10.251/riverdata/images/world_map_med.gd2".
It is a 20 meg
file of the earth.
-- 
Edit bug report at http://bugs.php.net/?id=19418&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19418&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19418&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19418&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19418&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19418&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19418&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19418&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19418&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19418&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19418&r=globals



Thread (3 messages)

« previous php.bugs (#19404) next »