Lines 183-189
bool MOGL_Image::ChargerPNG(const char *
Link Here
|
183 |
info_ptr = png_create_info_struct(png_ptr); |
183 |
info_ptr = png_create_info_struct(png_ptr); |
184 |
if (info_ptr == NULL) |
184 |
if (info_ptr == NULL) |
185 |
{ |
185 |
{ |
186 |
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); |
186 |
png_destroy_read_struct(&png_ptr, NULL, NULL); |
187 |
return false; |
187 |
return false; |
188 |
} |
188 |
} |
189 |
|
189 |
|
Lines 191-197
bool MOGL_Image::ChargerPNG(const char *
Link Here
|
191 |
if (setjmp(png_jmpbuf(png_ptr))) |
191 |
if (setjmp(png_jmpbuf(png_ptr))) |
192 |
{ |
192 |
{ |
193 |
// On libère la mémoire |
193 |
// On libère la mémoire |
194 |
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); |
194 |
png_destroy_read_struct(&png_ptr, &info_ptr, NULL); |
195 |
return false; |
195 |
return false; |
196 |
} |
196 |
} |
197 |
|
197 |
|
Lines 235-241
bool MOGL_Image::ChargerPNG(const char *
Link Here
|
235 |
/* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */ |
235 |
/* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */ |
236 |
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) |
236 |
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) |
237 |
{ |
237 |
{ |
238 |
png_set_gray_1_2_4_to_8(png_ptr); |
238 |
png_set_expand_gray_1_2_4_to_8(png_ptr); |
239 |
} |
239 |
} |
240 |
|
240 |
|
241 |
/* Expand paletted or RGB images with transparency to full alpha channels |
241 |
/* Expand paletted or RGB images with transparency to full alpha channels |