summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2020-07-07 17:56:35 -0500
committerMax Rees <maxcrees@me.com>2020-07-07 17:56:35 -0500
commit3580df673d9dd6cb26e1e1cd38017029ca7ace79 (patch)
tree638ec84187c0bb794161f61dcd4181914543fe8c /user
parentf5ad03e26a97b2a02e6ede4c7db3ea88a836e6c4 (diff)
downloadpackages-3580df673d9dd6cb26e1e1cd38017029ca7ace79.tar.gz
packages-3580df673d9dd6cb26e1e1cd38017029ca7ace79.tar.bz2
packages-3580df673d9dd6cb26e1e1cd38017029ca7ace79.tar.xz
packages-3580df673d9dd6cb26e1e1cd38017029ca7ace79.zip
user/sane: add patch for #304 from @awilfox
Diffstat (limited to 'user')
-rw-r--r--user/sane/APKBUILD4
-rw-r--r--user/sane/BTS-304.patch30
2 files changed, 33 insertions, 1 deletions
diff --git a/user/sane/APKBUILD b/user/sane/APKBUILD
index e3a9926d8..d9f618013 100644
--- a/user/sane/APKBUILD
+++ b/user/sane/APKBUILD
@@ -44,6 +44,7 @@ source="https://gitlab.com/sane-project/backends/uploads/c3dd60c9e054b5dee1e7b01
network.patch
pidfile.patch
check.patch
+ BTS-304.patch
"
builddir="$srcdir"/$_pkgname-$pkgver
@@ -144,4 +145,5 @@ c7523b2684726cf35c0b251fe2e1863120284ff6ea3f93b53feb5dfa020c1e383910ecdd1a0c77a2
1779ff8beb1ba5f9238c25d819a7f0045f7e257c19b511315feb85650e445ca86450a9e1d7ff8650499d3dae808589a6c2e358d5f3f39a3f40ce4999179b86d6 include.patch
dfeaef3c94c3e66b1cfb27348b8e1f3620143fd9a41e3c0b33d9c16f9bc4af2b20e40c83fec385c5765e8c3a812a00508bccdf8f27d571cfc0d8fac9dee41205 network.patch
8f0a1529a5793bc78422419b674963b543527c932476c9ea2d92ea0ad0a286691da306020824c1aaa0b35929f571480d21d7fc464a9f652e15664854c75a4cea pidfile.patch
-4de6f60452c0451769f5ce41e41ca4c2867a723e0d2bf22796dc8a266359bdc8a9e9542f4ba2dc42b15bd25b1c83d2c339177796043fdbcbc9d73ad4957f723c check.patch"
+4de6f60452c0451769f5ce41e41ca4c2867a723e0d2bf22796dc8a266359bdc8a9e9542f4ba2dc42b15bd25b1c83d2c339177796043fdbcbc9d73ad4957f723c check.patch
+de2bd02d02e9a2d061d7c5783d3e4e64e9a68e83b15adc122946efff369ad5e382bd918a9585f5fe99ede546f002bb3db0f1b54306f4409fde38b2e26c008162 BTS-304.patch"
diff --git a/user/sane/BTS-304.patch b/user/sane/BTS-304.patch
new file mode 100644
index 000000000..64b7dca02
--- /dev/null
+++ b/user/sane/BTS-304.patch
@@ -0,0 +1,30 @@
+diff --git a/backend/genesys/image_pixel.cpp b/backend/genesys/image_pixel.cpp
+index 1b83e127d..1ebba7fe0 100644
+--- a/backend/genesys/image_pixel.cpp
++++ b/backend/genesys/image_pixel.cpp
+@@ -46,6 +46,7 @@
+ #include "image.h"
+
+ #include <array>
++#include <cmath>
+
+ namespace genesys {
+
+@@ -207,7 +208,7 @@ void set_pixel_to_row(std::uint8_t* data, std::size_t x, Pixel pixel, PixelForma
+ float val = (pixel.r >> 8) * 0.3f;
+ val += (pixel.g >> 8) * 0.59f;
+ val += (pixel.b >> 8) * 0.11f;
+- data[x] = static_cast<std::uint16_t>(val);
++ data[x] = static_cast<std::uint16_t>(roundf(val));
+ return;
+ }
+ case PixelFormat::I16: {
+@@ -215,7 +216,7 @@ void set_pixel_to_row(std::uint8_t* data, std::size_t x, Pixel pixel, PixelForma
+ float val = pixel.r * 0.3f;
+ val += pixel.g * 0.59f;
+ val += pixel.b * 0.11f;
+- auto val16 = static_cast<std::uint16_t>(val);
++ auto val16 = static_cast<std::uint16_t>(roundf(val));
+ data[x] = val16 & 0xff;
+ data[x + 1] = (val16 >> 8) & 0xff;
+ return;