pkgsrc/graphics/gtksee/patches/patch-src_detect.c

30 lines
845 B
C
Raw Normal View History

2011-02-14 20:16:14 +01:00
$NetBSD: patch-src_detect.c,v 1.2 2011/02/14 19:16:14 wiz Exp $
2011-02-07 02:31:57 +01:00
Fix build with png-1.5.
2011-02-14 20:16:14 +01:00
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3131&group_id=735
2011-02-07 02:31:57 +01:00
--- src/detect.c.orig 2004-02-14 15:16:33.000000000 +0000
+++ src/detect.c
@@ -119,14 +119,16 @@ static gboolean
detect_png(guchar *filename, ImageInfo *info)
{
#ifdef HAVE_LIBPNG
- png_info pnginfo;
+ gint width;
+ gint height;
+ png_byte color_type;
- if (png_get_header(filename, &pnginfo))
+ if (png_get_header(filename, &width, &height, &color_type))
{
info->type = PNG;
- info->width = pnginfo.width;
- info->height = pnginfo.height;
- switch (pnginfo.color_type)
+ info->width = width;
+ info->height = height;
+ switch (color_type)
{
case PNG_COLOR_TYPE_RGB :
info->ncolors = 24;