Here is a patch to fix issue #1271 http://bugs.call-cc.org/ticket/1271

>From 7bb5dacc1cdec113d11eedf207b0b5eefd2114d5 Mon Sep 17 00:00:00 2001
From: "John J. Foerch" <[email protected]>
Date: Sun, 11 Sep 2016 17:49:53 -0400
Subject: [PATCH] image-create: clear image

fixes #1271

diff --git a/imlib2.scm b/imlib2.scm
index 27b119e..23f0abd 100644
--- a/imlib2.scm
+++ b/imlib2.scm
@@ -179,7 +179,12 @@
 	    (imlib-err 'image-create "Could not create new image" (list width height))
 	    (begin
 	      (image-alpha-set! img #t)
-	      (image-fill-rectangle img (color/rgba 0 0 0 0) 0 0 width height)
+              ((foreign-lambda* void ((image img) (int width) (int height))
+                 "imlib_context_set_image(img);\n"
+                 "DATA32* data = imlib_image_get_data();\n"
+                 "memset(data, 0, 4 * width * height);\n"
+                 "imlib_image_put_back_data(data);\n")
+               (image-ptr img) width height)
 	      (set-finalizer! img gc-collect-image))))))
 
 (define (gc-collect-image img)
-- 
2.9.3

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to