ID: 19817
User updated by: sprice@wisc.edu
Reported By: sprice@wisc.edu
Status: Open
Bug Type: GD related
Operating System: Darwin 6.1 (Mac 10.2.1)
PHP Version: 4CVS-2002-10-08
New Comment:
Are you using the GD2 files at my site? I have reencoded them to work.
Do you want me to make an example GD2 file that doesn't work?
Previous Comments:
------------------------------------------------------------------------
[2002-10-10 03:14:04] mfischer@php.net
Maybe Darwin/Mac related problem, works fine under Linux.
------------------------------------------------------------------------
[2002-10-08 11:15:07] sprice@wisc.edu
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 this bug report at http://bugs.php.net/?id=19817&edit=1