From ca9627e70852f6b2e835660df870fe3ab405882d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 1 Sep 2019 00:00:32 +0200 Subject: Initial import --- media-libs/imlib/files/imlib-1.9.15-libpng15.patch | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 media-libs/imlib/files/imlib-1.9.15-libpng15.patch (limited to 'media-libs/imlib/files/imlib-1.9.15-libpng15.patch') diff --git a/media-libs/imlib/files/imlib-1.9.15-libpng15.patch b/media-libs/imlib/files/imlib-1.9.15-libpng15.patch new file mode 100644 index 0000000..7837cd4 --- /dev/null +++ b/media-libs/imlib/files/imlib-1.9.15-libpng15.patch @@ -0,0 +1,142 @@ +--- gdk_imlib/io-png.c ++++ gdk_imlib/io-png.c +@@ -40,13 +40,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; +@@ -275,13 +275,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; +@@ -301,6 +301,9 @@ + /* Setup Translators */ + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_expand(png_ptr); ++ if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) ++ png_set_expand(png_ptr); ++ + png_set_strip_16(png_ptr); + png_set_packing(png_ptr); + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) +@@ -440,13 +443,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; +@@ -635,7 +638,7 @@ + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); + return 0; + } +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + fclose(f); + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); +--- Imlib/load.c ++++ Imlib/load.c +@@ -197,12 +197,12 @@ + png_destroy_read_struct(&png_ptr, NULL, NULL); + return NULL; + } +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; +@@ -260,7 +260,8 @@ + png_read_image(png_ptr, lines); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + ptr = data; +- if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ++ if (color_type == PNG_COLOR_TYPE_GRAY ++ || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + { + for (y = 0; y < *h; y++) + { +@@ -285,6 +286,7 @@ + } + } + } ++#if 0 + else if (color_type == PNG_COLOR_TYPE_GRAY) + { + for (y = 0; y < *h; y++) +@@ -300,6 +302,7 @@ + } + } + } ++#endif + else + { + for (y = 0; y < *h; y++) +--- Imlib/save.c ++++ Imlib/save.c +@@ -342,7 +342,7 @@ + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); + return 0; + } +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + fclose(f); + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); +--- Imlib/utils.c ++++ Imlib/utils.c +@@ -1981,14 +1981,13 @@ + png_destroy_read_struct(&png_ptr, NULL, NULL); + return NULL; + } +- +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; -- cgit v1.2.3