Skip to content

Commit bca1fb0

Browse files
committed
Merge remote-tracking branch 'stefanv/Low-bit_depth-png'
Conflicts: src/_png.cpp
2 parents 89f4421 + f57dddc commit bca1fb0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/_png.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ _png_module::_read_png(const Py::Object& py_fileobj, const bool float_result)
467467

468468
PyArrayObject *A = NULL;
469469
if (float_result) {
470-
double max_value = (1 << ((bit_depth < 8) ? 8 : bit_depth)) - 1;
471-
472-
A = (PyArrayObject *) PyArray_SimpleNew(num_dims, dimensions, NPY_FLOAT);
470+
double max_value = (1 << bit_depth) - 1;
471+
PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(
472+
num_dims, dimensions, PyArray_FLOAT);
473473

474474
if (A == NULL)
475475
{

0 commit comments

Comments
 (0)