php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13650 ImageWBMP does not make correct output.
Submitted: 2001-10-12 06:12 UTC Modified: 2002-06-28 05:33 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:0 of 0 (0.0%)
From: js at NetCamp dot se Assigned:
Status: Closed Package: GD related
PHP Version: 4.1.2 OS: Solaris 7 (SunOS 5.7)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: js at NetCamp dot se
New email:
PHP Version: OS:

 

 [2001-10-12 06:12 UTC] js at NetCamp dot se
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 );
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-13 09:24 UTC] sniper@php.net
Both work for me just fine. You could try updating GD
to 1.8.4.

--Jani

 [2001-11-09 14:55 UTC] sander@php.net
No feedback. Closing.
 [2001-11-12 04:10 UTC] js at NetCamp dot se
I have now recompiled vith gd 1.8.4. It did not help! Still the same problem.

Regards,
Johan S?rliden
 [2001-11-18 19:02 UTC] sniper@php.net
Could you please attach the diff of your php.ini and the  
php.ini-dist from the release? 

(diff -u /path/to/php.ini /path/to/php.ini-dist )

--Jani


 [2001-11-19 08:06 UTC] js at NetCamp dot se
Here is the diff...

diff php.ini php.ini-dist

217c217
< log_errors = On
---
> log_errors = Off
223c223
< error_prepend_string = "<font color=ff0000>"
---
> ;error_prepend_string = "<font color=ff0000>"
226c226
< error_append_string = "</font>"
---
> ;error_append_string = "</font>"
229c229
< error_log = /var/apache/logs/php_error_log
---
> ;error_log = filename
341c341
< upload_tmp_dir = /var/apache/upload
---
> ;upload_tmp_dir =
344c344
< upload_max_filesize = 12M
---
> upload_max_filesize = 2M

/ Johan
 [2002-03-21 11:07 UTC] sistemes at myp dot ad
I have also this problem with 
Sparc-Solaris 2.6
PHP-4.1.2
gd-1.8.4
 [2002-03-22 04:54 UTC] js at NetCamp dot se
I also still have the problem with PHP 4.1.2, gd 1.8.4, 
Solaris 7 and 8.

I use the workaround:
    ImageWBMP ( $im, "/tmp/test.wbmp" );
    readfile("/tmp/test.wbmp");
    unlink("/tmp/test.wbmp");

You should use a "better" filename if your image could
bee accessed by more than one at the same time.
/ Johan
 [2002-06-28 05:33 UTC] sniper@php.net
Must be bug in libgd 1.8.4 as it works fine for me with
GD 2.0.1. Reopen if you still have this problem with
that and latest PHP release.

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 16:05:54 2022 UTC