From 6a77ba51ddc8ed95177fb16b82d8275c88f35349 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Mon, 25 Apr 2022 19:47:56 +0200 Subject: [PATCH] fix is_equal_to_sixteen in PNG I/O extension While is_equal_to_sixteen should (as the name suggests) check for equality to 16, it actually checked whether the bit depth was less than 16. --- .../gil/extension/io/png/detail/write.hpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/boost/gil/extension/io/png/detail/write.hpp b/include/boost/gil/extension/io/png/detail/write.hpp index eee5b9ed1c..02c5422e68 100644 --- a/include/boost/gil/extension/io/png/detail/write.hpp +++ b/include/boost/gil/extension/io/png/detail/write.hpp @@ -171,10 +171,24 @@ class writer< Device {}; template - struct is_equal_to_sixteen : mp11::mp_less + struct is_equal_to_sixteen : mp11::mp_and < - std::integral_constant, - std::integral_constant + mp11::mp_not + < + mp11::mp_less + < + std::integral_constant, + std::integral_constant + > + >, + mp11::mp_not + < + mp11::mp_less + < + std::integral_constant, + std::integral_constant + > + > > {};