@@ -214,7 +214,7 @@ _png_module::read_png(const Py::Tuple& args) {
214
214
png_uint_32 height = info_ptr->height ;
215
215
216
216
int bit_depth = info_ptr->bit_depth ;
217
-
217
+
218
218
// Unpack 1, 2, and 4-bit images
219
219
if (bit_depth < 8 )
220
220
png_set_packing (png_ptr);
@@ -231,7 +231,7 @@ _png_module::read_png(const Py::Tuple& args) {
231
231
// Convert palletes to full RGB
232
232
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
233
233
png_set_palette_to_rgb (png_ptr);
234
-
234
+
235
235
// If there's an alpha channel convert gray to RGB
236
236
if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
237
237
png_set_gray_to_rgb (png_ptr);
@@ -262,7 +262,7 @@ _png_module::read_png(const Py::Tuple& args) {
262
262
dimensions[2 ] = 1 ; // Greyscale images
263
263
// For gray, return an x by y array, not an x by y by 1
264
264
int num_dims = (info_ptr->color_type & PNG_COLOR_MASK_COLOR) ? 3 : 2 ;
265
-
265
+
266
266
double max_value = (1 << ((bit_depth < 8 ) ? 8 : bit_depth)) - 1 ;
267
267
PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew (num_dims, dimensions, PyArray_FLOAT);
268
268
@@ -283,7 +283,7 @@ _png_module::read_png(const Py::Tuple& args) {
283
283
}
284
284
}
285
285
}
286
-
286
+
287
287
// free the png memory
288
288
png_read_end (png_ptr, info_ptr);
289
289
png_destroy_read_struct (&png_ptr, &info_ptr, png_infopp_NULL);
0 commit comments