Bug#1040629: Additional information

2023-07-20 Thread Gianfranco Costamagna

control: tags -1 patch pending

diff -Nru fdroidserver-2.2.1/debian/changelog 
fdroidserver-2.2.1/debian/changelog
--- fdroidserver-2.2.1/debian/changelog 2023-03-09 15:11:34.0 +0100
+++ fdroidserver-2.2.1/debian/changelog 2023-07-20 08:54:25.0 +0200
@@ -1,3 +1,13 @@
+fdroidserver (2.2.1-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  [ Vladimir Petko  ]
+  * debian/patches/image-alias-deprecation.patch:
+- cherry-pick upstream fix for new pillow 10.0.0
+  (Closes: #1040629, LP: #2028117)
+
+ -- Gianfranco Costamagna   Thu, 20 Jul 2023 
08:54:25 +0200
+
 fdroidserver (2.2.1-1) unstable; urgency=medium
 
   * New upstream version 2.2.1

diff -Nru fdroidserver-2.2.1/debian/patches/image-alias-deprecation.patch 
fdroidserver-2.2.1/debian/patches/image-alias-deprecation.patch
--- fdroidserver-2.2.1/debian/patches/image-alias-deprecation.patch 
1970-01-01 01:00:00.0 +0100
+++ fdroidserver-2.2.1/debian/patches/image-alias-deprecation.patch 
2023-07-20 08:54:23.0 +0200
@@ -0,0 +1,28 @@
+Description: do not use deprecated Image.ANTIALIAS attribute
+ The ANTIALIAS alias was removed in Pillow 10.0.0:
+ https://pillow.readthedocs.io/en/stable/deprecations.html
+Author: Hans-Christoph Steiner 
+Origin: upstream
+Bug: 
https://github.com/f-droid/fdroidserver/commit/132e953c8c9f7d709586442aee6ff474cfa8fa18
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040629
+Last-Update: 2023-07-19
+--- a/fdroidserver/update.py
 b/fdroidserver/update.py
+@@ -250,7 +250,7 @@
+
+ if any(length > size for length in im.size):
+ oldsize = im.size
+-im.thumbnail((size, size), Image.ANTIALIAS)
++im.thumbnail((size, size), Image.Resampling.LANCZOS)
+ logging.debug("%s was too large at %s - new size is %s" % (
+ iconpath, oldsize, im.size))
+ im.save(iconpath, "PNG", optimize=True,
+@@ -1757,7 +1757,7 @@
+
+ size = dpi_to_px(density)
+
+-im.thumbnail((size, size), Image.ANTIALIAS)
++im.thumbnail((size, size), Image.Resampling.LANCZOS)
+ im.save(icon_path, "PNG", optimize=True,
+ pnginfo=BLANK_PNG_INFO, icc_profile=None)
+ empty_densities.remove(density)
diff -Nru fdroidserver-2.2.1/debian/patches/series 
fdroidserver-2.2.1/debian/patches/series
--- fdroidserver-2.2.1/debian/patches/series2023-03-09 15:11:34.0 
+0100
+++ fdroidserver-2.2.1/debian/patches/series2023-07-20 08:54:16.0 
+0200
@@ -1,3 +1,4 @@
 debian-java-detection.patch
 ignore-irrelevant-test.patch
 scanner-tests-need-dexdump.patch
+image-alias-deprecation.patch



Bug#1040629: Additional information

2023-07-19 Thread Vladimir Petko
The original failure could be due to the network issue, as the tests
attempt to access the internet.



Bug#1040629: Additional information

2023-07-18 Thread Vladimir Petko
I have encountered the same error when running tests locally, but only
seen it once and could not reproduce it.

But when running a test against against pillow 10.0.0-1 the following
error occurs[1]

==
FAIL: test_process_apk (__main__.UpdateTest.test_process_apk)
--
Traceback (most recent call last):
  File "/tmp/autopkgtest.V6tBlg/build.2CL/real-tree/tests/update.TestCase",
line 949, in test_procesk
self.assertTrue(os.path.isfile(icon_path))
AssertionError: False is not true

It is already fixed upstream[2].

The attached patch contains the fix.

Thank you for considering the patch.

[1] 
https://autopkgtest.ubuntu.com/results/autopkgtest-mantic/mantic/amd64/f/fdroidserver/20230707_143232_ec734@/log.gz
[2] 
https://github.com/f-droid/fdroidserver/commit/132e953c8c9f7d709586442aee6ff474cfa8fa18
Description: do not use deprecated Image.ANTIALIAS attribute
 The ANTIALIAS alias was removed in Pillow 10.0.0:
 https://pillow.readthedocs.io/en/stable/deprecations.html
Author: Hans-Christoph Steiner 
Origin: upstream
Bug: https://github.com/f-droid/fdroidserver/commit/132e953c8c9f7d709586442aee6ff474cfa8fa18
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040629
Last-Update: 2023-07-19
--- a/fdroidserver/update.py
+++ b/fdroidserver/update.py
@@ -250,7 +250,7 @@
 
 if any(length > size for length in im.size):
 oldsize = im.size
-im.thumbnail((size, size), Image.ANTIALIAS)
+im.thumbnail((size, size), Image.Resampling.LANCZOS)
 logging.debug("%s was too large at %s - new size is %s" % (
 iconpath, oldsize, im.size))
 im.save(iconpath, "PNG", optimize=True,
@@ -1757,7 +1757,7 @@
 
 size = dpi_to_px(density)
 
-im.thumbnail((size, size), Image.ANTIALIAS)
+im.thumbnail((size, size), Image.Resampling.LANCZOS)
 im.save(icon_path, "PNG", optimize=True,
 pnginfo=BLANK_PNG_INFO, icc_profile=None)
 empty_densities.remove(density)