Opened 9 years ago

Closed 8 years ago

#1271 closed defect (fixed)

Imlib2 image-create initializes w/ garbage

Reported by: sandra Owned by:
Priority: major Milestone: someday
Component: extensions Version: 4.10.x
Keywords: imlib2 Cc:
Estimated difficulty: medium

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.

Change History (2)

comment:1 Changed 8 years ago by sjamaan

Estimated difficulty: medium

comment:2 Changed 8 years ago by Moritz Heidkamp

Resolution: fixed
Status: newclosed

Fixed in version 0.18

Note: See TracTickets for help on using tickets.