Skip to content

Commit 7911486

Browse files
authored
fix: is_equal_to_sixteen in PNG I/O was less-than test (#650)
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.
1 parent 9ed8fd2 commit 7911486

File tree

1 file changed

+17
-3
lines changed
  • include/boost/gil/extension/io/png/detail

1 file changed

+17
-3
lines changed

include/boost/gil/extension/io/png/detail/write.hpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,24 @@ class writer< Device
171171
{};
172172

173173
template<typename Info>
174-
struct is_equal_to_sixteen : mp11::mp_less
174+
struct is_equal_to_sixteen : mp11::mp_and
175175
<
176-
std::integral_constant<int, Info::_bit_depth>,
177-
std::integral_constant<int, 16>
176+
mp11::mp_not
177+
<
178+
mp11::mp_less
179+
<
180+
std::integral_constant<int, Info::_bit_depth>,
181+
std::integral_constant<int, 16>
182+
>
183+
>,
184+
mp11::mp_not
185+
<
186+
mp11::mp_less
187+
<
188+
std::integral_constant<int, 16>,
189+
std::integral_constant<int, Info::_bit_depth>
190+
>
191+
>
178192
>
179193
{};
180194

0 commit comments

Comments
 (0)