Summary
Imlib2 image-create initializes w/ garbage
Metadata
- Id: 19b3a24c6bd185bb858d64dde6525830afb219c0
- Trac id: 1271
- Type: defect
- Reporter: sandra
- Owner:
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty: medium
- Resolution: fixed
- Priority: major
- Milestone: someday
- Version: 4.10.x
- Changetime: 2016-10-02 13:37:24 UTC
- Created: 2016-03-20 08:50:30 UTC
- Keywords: imlib2
Description
image-create calls the foreign lambda imlib_create_image which initializes as garbage. To fix that, it then calls (image-fill-rectangle img (color/rgba 0 0 0 0) 0 0 width height) with the purpose of setting it all as 0 0 0 0 pixels. The problem is that doesn't work, it stays garbage, because image-fill-rectangle doesn't overwrite pixels, it just blends with them.
As a proof of concept for this bug, try calling (image-fill-rectangle output (color/rgba 0 0 0 0) 0 0 w h) on an image after calling (image-fill-rectangle output (color/rgba 255 255 255 255) 0 0 w h). It'll still be white, because filling a rectangle with transparency doesn't overwrite with transparency, it just adds transparency "on top".
What a weird bug; I couldn't come up with a solution. Love the imlib2 egg, but this makes create-image sort of a useless part of it. There's no documented way to clear or erase pixels, to set them to transparent, by using the egg.
Changes and comments
[2016-08-25 20:31:30 UTC] sjamaan set difficulty to medium
[2016-10-02 13:37:24 UTC] syn changed status from new to closed
[2016-10-02 13:37:24 UTC] syn set resolution to fixed
[2016-10-02 13:37:24 UTC] syn wrote:
Fixed in version 0.18