ID:               41508
 User updated by:  mmellon at ecrsoft dot com
 Reported By:      mmellon at ecrsoft dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         GD related
 Operating System: Windows XP SP2
 PHP Version:      5.2.2
 New Comment:

I had confused WBMP format with DIB... oops.


Previous Comments:
------------------------------------------------------------------------

[2007-05-27 02:02:25] mmellon at ecrsoft dot com

Description:
------------
I wrote a very simple class to represent code39 barcodes and output
images and noticed that I could output a two-color image to png without
issue, but the wbmp output is broken. When attempting to open the files
generated by imagewbmp() or image2wbmp, mspaint throws an error dialog
and states that it is not a valid file format. I am using Firefox to
view png files and mspaint to view wbmp files. I installed php 5.2.2
(CLI only) with the gd extension using the installer from www.php.net. I
will provide a very short code snippet that demonstrates the problem.

I did note that in the gd2 docs there is a note about opening files for
output under Windows - see note at:
http://www.libgd.org/OldImageCreation#void_gdImageWBMP.28gdImagePtr_im.2C_int_fg.2C_FILE_.2Aout.29
(I'm not sure exactly how the gd extension works so I don't know if
this has anything to do with it)

Reproduce code:
---------------
<?php

$theimage = imagecreate(100,100);
$black = imagecolorallocate($theimage,0,0,0);
$white = imagecolorallocate($theimage,255,255,255);
imagefilledrectangle($theimage, 10, 10, 89, 89, $white);
imagewbmp($theimage, 'c:\sample1.bmp');
imagewbmp($theimage, 'c:\sample2.bmp', 127);
image2wbmp($theimage, 'c:\sample3.bmp');
image2wbmp($theimage, 'c:\sample4.bmp',$white);
image2wbmp($theimage, 'c:\sample5.bmp',$black);
imagepng($theimage, 'c:\sample.png');

?>

Expected result:
----------------
I should be able to open sample.png and sample[n].bmp in respective
viewers and see the same image.

Actual result:
--------------
sample.png opens in Firefox and shows a black square as expected.
None of the sample wbmp files will open in mspaint, at all.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41508&edit=1

Reply via email to