forked from ports/contrib
28 lines
920 B
Diff
28 lines
920 B
Diff
diff -pruN mtpaint-3.31.old//src/png.c mtpaint-3.31/src/png.c
|
|
--- mtpaint-3.31.old//src/png.c 2010-11-18 12:03:43.000000000 +0100
|
|
+++ mtpaint-3.31/src/png.c 2010-11-18 12:07:38.000000000 +0100
|
|
@@ -539,7 +539,11 @@ static int load_png(char *file_name, ls_
|
|
if (settings->bpp == 3)
|
|
{
|
|
png_set_strip_16(png_ptr);
|
|
+#if PNG_LIBPNG_VER < 10400
|
|
png_set_gray_1_2_4_to_8(png_ptr);
|
|
+#else
|
|
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
|
|
+#endif
|
|
png_set_palette_to_rgb(png_ptr);
|
|
png_set_gray_to_rgb(png_ptr);
|
|
|
|
@@ -644,7 +648,11 @@ static int load_png(char *file_name, ls_
|
|
png_set_strip_alpha(png_ptr);
|
|
png_set_packing(png_ptr);
|
|
if ((color_type == PNG_COLOR_TYPE_GRAY) && (bit_depth < 8))
|
|
+#if PNG_LIBPNG_VER < 10400
|
|
png_set_gray_1_2_4_to_8(png_ptr);
|
|
+#else
|
|
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
|
|
+#endif
|
|
for (i = 0; i < height; i++)
|
|
{
|
|
row_pointers[i] = settings->img[CHN_IMAGE] + i * width;
|