[Pkg-electronics-commits] [pcb] 02/04: Added hid_png.diff patch from upstream which fixes hid_png3 test

أحمد المحمودي (Ahmed El-Mahmoudy) aelmahmoudy at sabily.org
Wed Aug 27 12:40:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

aelmahmoudy-guest pushed a commit to branch master
in repository pcb.

commit 69eb213b382f7a80659c7bc3192cf1ad7ece496c
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
Date:   Wed Aug 27 14:59:21 2014 +0300

    Added hid_png.diff patch from upstream which fixes hid_png3 test
    
    The test will remain disabled though, as the change to the output png
    cannot be represented in the diff
    
    Closes: #754760
---
 debian/patches/hid_png.diff | 36 ++++++++++++++++++++++++++++++++++++
 debian/patches/series       |  1 +
 2 files changed, 37 insertions(+)

diff --git a/debian/patches/hid_png.diff b/debian/patches/hid_png.diff
new file mode 100644
index 0000000..665909b
--- /dev/null
+++ b/debian/patches/hid_png.diff
@@ -0,0 +1,36 @@
+Description: png: add explicit round() calls to the scaling
+ After this commit the tests pass on both 32- and 64-bit builds.
+ Hopefully this time it's really dead; the previous "fix" af27c2d
+ by myself merely increased the DPI of the output, but this one
+ attempts to get deterministic rounding behaviour.
+Origin: http://git.geda-project.org/pcb/commit/?id=137e17afdcf21bcff53767ac9412ffb7535ca706
+Bug: https://launchpad.net/bugs/860037
+Bug-Debian: https://bugs.debian.org/754760
+
+---
+diff --git a/src/hid/png/png.c b/src/hid/png/png.c
+index ff60a76..442b901 100644
+--- a/src/hid/png/png.c
++++ b/src/hid/png/png.c
+@@ -69,9 +69,9 @@ static double scale = 1;
+ static Coord x_shift = 0;
+ static Coord y_shift = 0;
+ static int show_solder_side;
+-#define SCALE(w)   ((int)((w)/scale + 0.5))
+-#define SCALE_X(x) ((int)(((x) - x_shift)/scale))
+-#define SCALE_Y(y) ((int)(((show_solder_side ? (PCB->MaxHeight-(y)) : (y)) - y_shift)/scale))
++#define SCALE(w)   ((int)round((w)/scale))
++#define SCALE_X(x) ((int)round(((x) - x_shift)/scale))
++#define SCALE_Y(y) ((int)round(((show_solder_side ? (PCB->MaxHeight-(y)) : (y)) - y_shift)/scale))
+ #define SWAP_IF_SOLDER(a,b) do { Coord c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
+
+ /* Used to detect non-trivial outlines */
+@@ -913,7 +913,7 @@ png_do_export (HID_Attr_Val * options)
+        * a scale of 1  means 1 pixel is 1 inch
+        * a scale of 10 means 1 pixel is 10 inches
+        */
+-      scale = INCH_TO_COORD(1) / dpi;
++      scale = round(INCH_TO_COORD(1) / (double) dpi);
+       w = w / scale;
+       h = h / scale;
+     }
diff --git a/debian/patches/series b/debian/patches/series
index 8feb150..6233bda 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ outdated_config.diff
 disable_hid_png3_test.diff
 drop_check_global_included.patch
 desktop-file-main-category.diff
+hid_png.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/pcb.git



More information about the Pkg-electronics-commits mailing list