From: sprice@wisc.edu
Operating system: Darwin 6.1 (Mac 10.2.1)
PHP version: 4CVS-2002-10-08
PHP Bug Type: GD related
Bug description: ImageCreateFromGD2() doesnt recognize uncompressed .gd2 images
ImageCreateFromGD2() does not recognize a uncompressed gd2
file. It seems to work just fine with compressed GD2 files,
but I am having problems compressing a GD2 file of mine.
(pngtogd2 gives a "Bus error" when I try to compress, not a
PHP problem tho)
This script:
<?php
header( "Content-type: image/png" );
$medimg = $_SERVER['DOCUMENT_ROOT'] . "/riverdata/images/
world_map_med.gd2";
$medimg = ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600
);
$img = ImageCreateTrueColor( 800, 600 );
ImageCopy( $img, $medimg, 0, 0, 0, 0, 800, 600 );
ImageDestroy( $medimg );
ImagePNG( $img );
ImageDestroy( $img );
?>
Leaves this in the error log:
[Tue Oct 8 09:25:50 2002] [error] PHP Warning:
imagecreatefromgd2part() [<a href='http://www.php.net/
function.imagecreatefromgd2part'>
function.imagecreatefromgd2part</a>]: '/Library/WebServer/
Documents/riverdata/images/world_map_med.gd2' is not a
valid GD2 file in /Library/WebServer/Documents/riverdata/
scripts/test.php on line 3
[Tue Oct 8 09:25:50 2002] [error] PHP Warning:
imagecopy(): supplied argument is not a valid Image
resource in /Library/WebServer/Documents/riverdata/scripts/
test.php on line 4
[Tue Oct 8 09:25:50 2002] [error] PHP Warning:
imagedestroy(): supplied argument is not a valid Image
resource in /Library/WebServer/Documents/riverdata/scripts/
test.php on line 4
The error occours when I use this command to create the GD2
file:
% /usr/local/bin/pngtogd2 world_map_med.png
world_map_med.gd2 800 1
and doesn't when I use this:
% /usr/local/bin/pngtogd2 world_map_med.png
world_map_med.gd2 800 2
Usage: pngtogd2 filename.png filename.gd2 cs fmt
where cs is the chunk size
fmt is 1 for raw, 2 for compressed
The files that I am using can be found here:
http://144.92.10.251/riverdata/images/
Keep in mind tho that I have no way of telling that a valid
GD2 file is being created in the first place because I know
of nothing else that uses (or creates) the GD2 file format
other than the GD library itself.
--
Edit bug report at http://bugs.php.net/?id=19817&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19817&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19817&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19817&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19817&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19817&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19817&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19817&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19817&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19817&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19817&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19817&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=19817&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=19817&r=isapi