During a rebuild of all packages in unstable, package "resvg"
failed to build due to the newer version of src:rust-zune-jpeg
which was uploaded on 2025-06-27.

Thank you.

A quick look suggests that other rdeps are ok, and this is just
an issue with resvg.

I have filed a bug about this upstream at

https://github.com/linebender/resvg/issues/942

I have determined that increasing the comparision tolerance
from 1LSB to 4LSB in resvg's tests makes the tests pass.

I have also narrowed it down to a series of 3 commits in the
zune-jpeg-4.12 branch of the zune-image git repository.

* 8c46d5a6f2cf324ede4c5a5f60bceee0d943c4da - "jpeg/idct: Fix idct blurry 
images", structure_image_no_height and structure_image_no_width fail
* 03de591c94cbdd1b7e0a8e9de06fd638179f3445 - "jpeg/color_convert: Use more accurate 
color conversion functions", fails to build
* ac3c2c5481aa1b4eb6c52a98e73e4998d472e2c0 - "jpeg/color_convert: Use more accurate 
color conversion functions", all 9 tests fail.

These seem like positive changes which would be expected to change
the output to me, so unless someone has evidence that these changes
are in some way broken, I think that post-trixie this needs to be
dealt with on the resvg side.

I intend to keep this bug assigned to zune-jpeg until the trixie
release, then reassign it to resvg.

I see several possible approaches to fixing resvg.

1. Upload a new upstream version with the issue fixed.
2. Change the "expected results" in Debian.
3. Increase the tolerance in Debian for all comparisions tests.
4. Increase the tolerance in Debian for only the tests that are failing.

Option 1 is the best option long term, but is only possible if/when
upstream releases a new version.

Option 2 is problematic because the expected results are png files, and
diff/patch doesn't work on those.

Option 3 is what I have prepared and attatched a patch for.

Option 4 would be a more intrustive patch than option 3, but I'm happy
to prepare it if you would like.

diff -Nru resvg-0.45.1/debian/changelog resvg-0.45.1/debian/changelog
--- resvg-0.45.1/debian/changelog       2025-04-17 04:47:04.000000000 +0000
+++ resvg-0.45.1/debian/changelog       2025-07-24 18:27:57.000000000 +0000
@@ -1,3 +1,11 @@
+resvg (0.45.1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Relax image comparision tests to allow 4lsb of delta instead of 1lsb
+    (Closes: 1109712)
+
+ -- Peter Michael Green <plugw...@debian.org>  Thu, 24 Jul 2025 18:27:57 +0000
+
 resvg (0.45.1-1) unstable; urgency=medium
 
   [ upstream ]
diff -Nru resvg-0.45.1/debian/patches/2003_relax_comparisions.patch 
resvg-0.45.1/debian/patches/2003_relax_comparisions.patch
--- resvg-0.45.1/debian/patches/2003_relax_comparisions.patch   1970-01-01 
00:00:00.000000000 +0000
+++ resvg-0.45.1/debian/patches/2003_relax_comparisions.patch   2025-07-24 
18:25:18.000000000 +0000
@@ -0,0 +1,31 @@
+Description: Allow a greater pixel delta in output comparision tests
+ The update of zune-jpeg from 0.4.14-1 to 0.4.18 included some fixes that
+ change the output slightly. This causes some of resvg's output comparison
+ tests to fail.
+
+ We can't easilly change the reference images in Debian because they are
+ png files, which diff/patch do not work on. So instead we increase the
+ tolerance in the tests.
+Author: Peter Michael Green <plugw...@debian.org>
+Bug: https://github.com/linebender/resvg/issues/942
+Bug-Debian: https://bugs.debian.org/1109712
+Forwarded: not-needed
+Last-Update: 2025-07-24
+
+--- resvg-0.45.1.orig/crates/resvg/tests/integration/main.rs
++++ resvg-0.45.1/crates/resvg/tests/integration/main.rs
+@@ -240,10 +240,10 @@ fn load_png(path: &str) -> Vec<u8> {
+ 
+ // TODO: remove
+ fn is_pix_diff(c1: rgb::RGBA8, c2: rgb::RGBA8) -> bool {
+-    (c1.r as i32 - c2.r as i32).abs() > 1
+-        || (c1.g as i32 - c2.g as i32).abs() > 1
+-        || (c1.b as i32 - c2.b as i32).abs() > 1
+-        || (c1.a as i32 - c2.a as i32).abs() > 1
++    (c1.r as i32 - c2.r as i32).abs() > 4
++        || (c1.g as i32 - c2.g as i32).abs() > 4
++        || (c1.b as i32 - c2.b as i32).abs() > 4
++        || (c1.a as i32 - c2.a as i32).abs() > 4
+ }
+ 
+ #[allow(dead_code)]
diff -Nru resvg-0.45.1/debian/patches/series resvg-0.45.1/debian/patches/series
--- resvg-0.45.1/debian/patches/series  2025-04-17 04:44:19.000000000 +0000
+++ resvg-0.45.1/debian/patches/series  2025-07-24 18:14:16.000000000 +0000
@@ -5,3 +5,4 @@
 2001_rustyfuzz.patch
 2001_svgtypes.patch
 2002_privacy.patch
+2003_relax_comparisions.patch

Reply via email to