From e4017e34baec05ee0a45800ed8efb2ff6d5c9f5a Mon Sep 17 00:00:00 2001 From: glennrp Date: Sat, 8 Jan 2011 17:16:09 +0000 Subject: [PATCH] Quieted warnings about png_get_iCCP and png_set_iCCP arising from libpng-1.5.0 --- ChangeLog | 5 +++++ coders/png.c | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19d252d5a..6017885c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-08 6.6.7-1 Glenn Randers-Pehrson + * Quieted some inconsequential warnings in the PNG codec due to a + change in the type of the PNG iCCP profile from png_charp to png_bytep + in libpng-1.5.0. + 2011-01-03 6.6.7-0 Cristy * Handle negative heights for ICO images. diff --git a/coders/png.c b/coders/png.c index 34c92cd39..1ec018682 100644 --- a/coders/png.c +++ b/coders/png.c @@ -1348,7 +1348,7 @@ static void PNGErrorHandler(png_struct *ping,png_const_charp message) (void) ThrowMagickException(&image->exception,GetMagickModule(),CoderError, message,"`%s'",image->filename); -#if PNG_LIBPNG_VER < 10500 +#if (PNG_LIBPNG_VER < 10500) longjmp(ping->jmpbuf,1); #else png_longjmp(ping,1); @@ -1853,8 +1853,15 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, int compression; +#if (PNG_LIBPNG_VER < 10500) + png_charp + info; +#else + png_bytep + info; +#endif + png_charp - info, name; png_uint_32 @@ -8268,7 +8275,11 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, if (ping_exclude_iCCP == MagickFalse) { png_set_iCCP(ping,ping_info,(const png_charp) name,0, +#if (PNG_LIBPNG_VER < 10500) (png_charp) GetStringInfoDatum(profile), +#else + (png_const_bytep) GetStringInfoDatum(profile), +#endif (png_uint_32) GetStringInfoLength(profile)); } } -- 2.40.0