ID: 8137
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: GD related
Assigned To: 
Comments:

Fixed in CVS. (fix will be in 4.0.6)

--Jani


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

[2000-12-06 12:02:11] [EMAIL PROTECTED]
when saving an image as wbmp (imagewbmp) i get the following
problems

1) if i load the image and then save it again as a jpeg,
then i will get a negative of the original.

2) when viewing the wbmp file - i viewed it at
http://www.teraflops.com/wbmp/ - i get the same "negative"
result :)

the following script demonstrates:

<?php

    $im = ImageCreate(200, 200);
    $black = ImageColorAllocate($im,0,0,0);
    $white = ImageColorAllocate($im,255,255,255);

    ImageLine($im, 0, 0, 199, 199, $white);
// create the wmbp file
    ImageWbmp($im,"../tmp/tmp_ImageCreateFromWbmp1.bmp");

// load it from disk
$im2 =
ImageCreateFromWbmp("../tmp/tmp_ImageCreateFromWbmp1.bmp");

// save as jpeg and wbmp again

    ImageWbmp($im2,"../tmp/tmp_ImageCreateFromWbmp2.bmp");
    ImageJpeg($im2,"../tmp/tmp_ImageCreateFromWbmp3.jpeg");

    ImageDestroy($im);
    ImageDestroy($im2);
?>

i would expect to see white diagnol across a black
backgrouond, but what i get the opposite - black diagonal
across a white background

the problem seems to be in the function:
_php_image_output_wbmp.

the following code
if(im->pixels[y][x] == 0) c = c | (1 << (7-p));
should be (i think)
if(im->pixels[y][x] != 0) c = c | (1 << (7-p));

(a != instead of an ==)

this gets the jpeg to be displayed correctly, but the wbmp
is still backwards (therefore not a complete fix??)

ONn



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



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8137&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to