Bug #13650: ImageWBMP does not make correct output.
| From: | js at NetCamp dot se | Date: | Fri, 12 Oct 2001 10:12:27 +0000 |
| Subject: | Bug #13650: ImageWBMP does not make correct output. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67837@lists.php.net to get a copy of this message | ||
From: js@NetCamp.se
Operating system: Solaris 7 (SunOS 5.7)
PHP version: 4.0.6
PHP Bug Type: GD related
Bug description: ImageWBMP does not make correct output.
Hi,
I have made a php script that make an image and should output this image
directly to the client (WAP).
There comes the same amount of bytes that the image should contain but it
is all zeros.
It works to output the image to an file but it does not work stright to the
client. No crashes just wrong output.
You could test "curl http://wap.netcamp.se/test_img.php >
test_does_not_work.wbmp" and
"curl http://wap.netcamp.se/test_img.wbmp
> test_works.wbmp"
Se script below.
I have PHP 4.0.6 and GD 1.8.3.
Configuration:
'./configure' '--with-apache=../apache_1.3.19' '--enable-track-vars'
'--with-imap=/usr/local/src/download/src/apache_php_mm_2000-12-14/imap-4.7c/c-client'
'--with-mysql=/usr/local/mysql' '--with-zlib=/usr/local'
'--with-gd=/usr/local'
'--with-jpeg-dir=/usr/local' '--with-xpm-dir=/usr/local'
'--with-ttf=/usr/local'
'--with-t1lib=/usr/local' '--with-curl=/usr/local' '--enable-exif'
Regards
Johan Sörliden
js@NetCamp.se
http://www.NetCamp.se
This is the script that i made:
<?PHP
Header("Content-type: image/vnd.wap.wbmp");
/* Create image and alocate colours */
$xmax = 95;
$ymax = 35;
$im = @imagecreate ( $xmax +1, $ymax +1 ) or die ("Cannot initialize
image stream");
$background = ImageColorAllocate ( $im, 255, 255, 255 );
$black = ImageColorAllocate ( $im, 0, 0, 0 );
$white = ImageColorAllocate ( $im, 255, 255, 255 );
/* Draw testimage */
imageline ( $im, 0, 0, $xmax, $ymax, $black );
imageline ( $im, 0, $ymax, $xmax, 0, $black );
imageline ( $im, 0, 0, 0, $ymax, $black );
imageline ( $im, 0, $ymax, $xmax, $ymax, $black );
imageline ( $im, $xmax, $ymax, $xmax, 0, $black );
imageline ( $im, $xmax, 0, 0, 0, $black );
/* Send image */
/* ImageWBMP ( $im, "/tmp/test.wbmp" ); This works */
ImageWBMP ( $im ); /* This does not work */
ImageDestroy ( $im );
?>
--
Edit bug report at: http://bugs.php.net/?id=13650&edit=1