public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in media-gfx/splashutils/files: splashutils-1.5.4.3-libpng15_compat.patch
@ 2011-05-08 15:30 Michael Januszewski (spock)
  0 siblings, 0 replies; only message in thread
From: Michael Januszewski (spock) @ 2011-05-08 15:30 UTC (permalink / raw
  To: gentoo-commits

spock       11/05/08 15:30:15

  Added:                splashutils-1.5.4.3-libpng15_compat.patch
  Log:
  Add a patch for libpng-1.5 compatiblity (bug #361333).
  
  (Portage version: 2.1.9.47/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  media-gfx/splashutils/files/splashutils-1.5.4.3-libpng15_compat.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-libpng15_compat.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-libpng15_compat.patch?rev=1.1&content-type=text/plain

Index: splashutils-1.5.4.3-libpng15_compat.patch
===================================================================
commit 1b760b583f1faa0d3114440a6746cbefa36dd797
Author: AlphatPC <AlphatPC@gmail.com>
Date:   Sun May 8 17:18:03 2011 +0200

    Use libpng accessor functions (for libpng-1.5 compat).

diff --git a/core/src/image.c b/core/src/image.c
index 6973575..4fb21a9 100644
--- a/core/src/image.c
+++ b/core/src/image.c
@@ -61,27 +61,27 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
 	png_init_io(png_ptr, fp);
 	png_read_info(png_ptr, info_ptr);
 
-	if (cmap && info_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
+	if (cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_PALETTE)
 		return -2;
 
-	if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-	    info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+	if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
+	    png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
 		png_set_gray_to_rgb(png_ptr);
 
-	if (info_ptr->bit_depth == 16)
+	if (png_get_bit_depth(png_ptr, info_ptr) == 16)
 		png_set_strip_16(png_ptr);
 
-	if (!want_alpha && info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
+	if (!want_alpha && png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
 		png_set_strip_alpha(png_ptr);
 
 #ifndef TARGET_KERNEL
-	if (!(info_ptr->color_type & PNG_COLOR_MASK_ALPHA) & want_alpha) {
+	if (!(png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) & want_alpha) {
 		png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER);
 	}
 #endif
 	png_read_update_info(png_ptr, info_ptr);
 
-	if (!cmap && info_ptr->color_type != PNG_COLOR_TYPE_RGB && info_ptr->color_type != PNG_COLOR_TYPE_RGBA)
+	if (!cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_RGB && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_RGBA)
 		return -3;
 
 	if (cmap) {
@@ -93,12 +93,12 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
 
 	rowbytes = png_get_rowbytes(png_ptr, info_ptr);
 
-	if ((width && *width && info_ptr->width != *width) || (height && *height && info_ptr->height != *height)) {
+	if ((width && *width && png_get_image_width(png_ptr, info_ptr) != *width) || (height && *height && png_get_image_height(png_ptr, info_ptr) != *height)) {
 		iprint(MSG_ERROR, "Image size mismatch: %s.\n", filename);
 		return -2;
 	} else {
-		*width = info_ptr->width;
-		*height = info_ptr->height;
+		*width = png_get_image_width(png_ptr, info_ptr);
+		*height = png_get_image_height(png_ptr, info_ptr);
 	}
 
 	*data = malloc(theme->xres * theme->yres * fbd.bytespp);
@@ -114,11 +114,11 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
 		return -4;
 	}
 
-	for (i = 0; i < info_ptr->height; i++) {
+	for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) {
 		if (cmap) {
-			row_pointer = *data + info_ptr->width * i;
+			row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i;
 		} else if (want_alpha) {
-			row_pointer = *data + info_ptr->width * i * 4;
+			row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i * 4;
 		} else {
 			row_pointer = buf;
 		}
@@ -127,7 +127,7 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
 
 		if (cmap) {
 			int h = 256 - cmap->len;
-			t = *data + info_ptr->width * i;
+			t = *data + png_get_image_width(png_ptr, info_ptr) * i;
 
 			if (h) {
 				/* Move the colors up by 'h' offset. This is used because fbcon
@@ -139,8 +139,8 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
 
 		/* We only need to convert the image if the alpha channel is not required */
 		} else if (!want_alpha) {
-			u8 *tmp = *data + info_ptr->width * bytespp * i;
-			rgba2fb((rgbacolor*)buf, tmp, tmp, info_ptr->width, i, 0, 0xff);
+			u8 *tmp = *data + png_get_image_width(png_ptr, info_ptr) * bytespp * i;
+			rgba2fb((rgbacolor*)buf, tmp, tmp, png_get_image_width(png_ptr, info_ptr), i, 0, 0xff);
 		}
 	}
 






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-08 15:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08 15:30 [gentoo-commits] gentoo-x86 commit in media-gfx/splashutils/files: splashutils-1.5.4.3-libpng15_compat.patch Michael Januszewski (spock)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox