-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The issue that BMP RLE occasionally swallowed some pixels[1] had been fixed long ago in libgd, but apparently it has been overlooked to port it to our bundled libgd. We also introduce the test helper `test_image_equals_image()` which compares in-memory images for equality. [1] <libgd/libgd#276> Closes GH-17250.
- Loading branch information
Showing
4 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
libgd bug 276 (Sometimes pixels are missing when storing images as BMPs) | ||
--EXTENSIONS-- | ||
gd | ||
--FILE-- | ||
<?php | ||
require __DIR__ . "/func.inc"; | ||
|
||
$orig = imagecreate(10, 10); | ||
imagecolorallocate($orig, 0, 0, 0); | ||
$white = imagecolorallocate($orig, 255, 255, 255); | ||
imageline($orig, 0, 0, 99, 99, $white); | ||
|
||
$filename = __DIR__ . "/gd276.bmp"; | ||
imagebmp($orig, $filename, true); | ||
$saved = imagecreatefrombmp($filename); | ||
var_dump($saved !== false); | ||
test_image_equals_image($orig, $saved); | ||
?> | ||
--EXPECT-- | ||
bool(true) | ||
The images are equal. | ||
--CLEAN-- | ||
<?php | ||
@unlink(__DIR__ . "/gd276.bmp"); | ||
?> |