Skip to content

Commit

Permalink
fix is_equal_to_sixteen in PNG I/O extension
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
striezel committed Apr 25, 2022
1 parent caf92fa commit 6a77ba5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions include/boost/gil/extension/io/png/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,24 @@ class writer< Device
{};

template<typename Info>
struct is_equal_to_sixteen : mp11::mp_less
struct is_equal_to_sixteen : mp11::mp_and
<
std::integral_constant<int, Info::_bit_depth>,
std::integral_constant<int, 16>
mp11::mp_not
<
mp11::mp_less
<
std::integral_constant<int, Info::_bit_depth>,
std::integral_constant<int, 16>
>
>,
mp11::mp_not
<
mp11::mp_less
<
std::integral_constant<int, 16>,
std::integral_constant<int, Info::_bit_depth>
>
>
>
{};

Expand Down

0 comments on commit 6a77ba5

Please sign in to comment.