guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit 72c6eb21f0bd67cf6e5182bfc2c17cbf1d1d8f44
Author: Hugo Buddelmeijer <[email protected]>
AuthorDate: Fri Oct 23 22:27:54 2026 +0200

    gnu: python-manim: Fix build with Pillow 13.
    
    * gnu/packages/patches/manim-pillow-13.patch: New file.
    * gnu/packages/python-graphics.scm (python-manim): Fix build with Pillow 13.
    [origin]<patches>: Use patch.
    
    Relates-to: guix/guix!12052
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/patches/manim-pillow-13.patch | 31 ++++++++++++++++++++++++++++++
 gnu/packages/python-graphics.scm           |  1 +
 2 files changed, 32 insertions(+)

diff --git a/gnu/packages/patches/manim-pillow-13.patch 
b/gnu/packages/patches/manim-pillow-13.patch
new file mode 100644
index 00000000000..79599ee6cc2
--- /dev/null
+++ b/gnu/packages/patches/manim-pillow-13.patch
@@ -0,0 +1,31 @@
+From 25fa4150c6a907822c776c5f41cfcbf765038d10 Mon Sep 17 00:00:00 2001
+From: Benjamin Hackl <[email protected]>
+Date: Tue, 20 Oct 2026 11:08:07 +0200
+Subject: Fix Cairo image rendering with Pillow 13
+
+Create the transparent compositing canvas directly as an RGBA image instead of 
reinterpreting a two-dimensional float64 array. Pillow 13 rejects the 
mismatched array mode.
+
+---
+ manim/camera/camera.py        |  7 ++--
+ tests/test_pillow13_compat.py | 61 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 65 insertions(+), 3 deletions(-)
+ create mode 100644 tests/test_pillow13_compat.py
+
+diff --git a/manim/camera/camera.py b/manim/camera/camera.py
+index b3371faf3e..6dfc08117b 100644
+--- a/manim/camera/camera.py
++++ b/manim/camera/camera.py
+@@ -1125,9 +1125,10 @@ def display_image_mobject(
+         )
+ 
+         # Paste into an image as large as the camera's pixel array.
+-        full_image = Image.fromarray(
+-            np.zeros((self.pixel_height, self.pixel_width)),
+-            mode="RGBA",
++        full_image = Image.new(
++            "RGBA",
++            (self.pixel_width, self.pixel_height),
++            (0, 0, 0, 0),
+         )
+         full_image.paste(
+             sub_image,
diff --git a/gnu/packages/python-graphics.scm b/gnu/packages/python-graphics.scm
index 381af7c6c2f..ba67698eba0 100644
--- a/gnu/packages/python-graphics.scm
+++ b/gnu/packages/python-graphics.scm
@@ -409,6 +409,7 @@ Design spec without sacrificing ease of use or application 
performance.")
               (url "https://github.com/ManimCommunity/manim";)
               (commit (string-append "v" version))))
        (file-name (git-file-name name version))
+       (patches (search-patches "manim-pillow-13.patch"))
        (sha256
         (base32 "1mvwg4zqpq8vsz68j2szzdl26v74gmvs27fa8n0yzscz2y2v08gw"))))
     (build-system pyproject-build-system)

Reply via email to