Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48c31f7

Browse files
committed
Fix PNG reading of palettized images.
1 parent 76665d0 commit 48c31f7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/_png.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ _png_module::_read_png(const Py::Object& py_fileobj, const bool float_result)
418418
if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE)
419419
{
420420
png_set_palette_to_rgb(png_ptr);
421+
bit_depth = 8;
421422
}
422423

423424
// If there's an alpha channel convert gray to RGB

0 commit comments

Comments
 (0)