summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schauer Marin Rodrigues <josch@debian.org>2022-01-25 11:59:16 +0100
committerJohannes Schauer Marin Rodrigues <josch@debian.org>2022-01-25 11:59:16 +0100
commitf77fefc81e7c4b235c47ae6777d222d391c59536 (patch)
tree840e9a18387dbff6ce5754c67c430befe419f449
parent72a240bada4c6a1789c128adc401e5c14b8a2607 (diff)
debian/patches/pillow9: fixup
-rw-r--r--debian/patches/pillow923
1 files changed, 22 insertions, 1 deletions
diff --git a/debian/patches/pillow9 b/debian/patches/pillow9
index 2fe5480..abe7bc7 100644
--- a/debian/patches/pillow9
+++ b/debian/patches/pillow9
@@ -1,9 +1,25 @@
--- a/src/img2pdf_test.py
+++ b/src/img2pdf_test.py
-@@ -6713,6 +6713,11 @@ def test_general(general_input, engine):
+@@ -4686,7 +4686,12 @@ def gif_animation_pdf(tmp_path_factory,
+ "^Pages: +2$", pdfinfo.decode("utf8"), re.MULTILINE
+ ), identify.decode("utf8")
+ subprocess.check_call(["pdfseparate", str(out_pdf), str(tmpdir / "page-%d.pdf")])
+- for page in [1, 2]:
++ pages = [1,2]
++ import PIL
++ if PIL.__version__ >= "9.0.0":
++ # PIL 9.0.0 stores all frames after the first as RGB instead of P
++ pages = [1]
++ for page in pages:
+ gif_animation_pdf_nr = tmpdir / ("page-%d.pdf" % page)
+ with pikepdf.open(gif_animation_pdf_nr) as p:
+ assert (
+@@ -6713,11 +6718,17 @@ def test_general(general_input, engine):
pydictx = rec(x.Root)
pydicty = rec(y.Root)
if f.endswith(os.path.sep + "animation.gif"):
++ import PIL
++
+ # PIL 9.0.0 stores all frames after the first as RGB instead of P
+ if PIL.__version__ >= "9.0.0":
+ orig_img.close()
@@ -12,3 +28,8 @@
# starting with PIL 8.2.0 the palette is half the size when encoding
# our test GIF image as PNG
#
+ # to still compare successfully, we truncate the expected palette
+- import PIL
+
+ if PIL.__version__ >= "8.2.0":
+ assert len(pydictx["/Pages"]["/Kids"]) == 2