comparison src/vigra-1-png.patch @ 1629:2288fcbf74ad

package vigra: libpng backwards-compatible
author Mark Brand <mabrand@mabrand.nl>
date Fri, 04 Mar 2011 22:45:04 +0100
parents 5772a60b7521
children
comparison
equal deleted inserted replaced
1628:817eb45b5d3d 1629:2288fcbf74ad
3 3
4 Posted 4 March 2011 on: 4 Posted 4 March 2011 on:
5 https://mailhost.informatik.uni-hamburg.de/pipermail/vigra/ 5 https://mailhost.informatik.uni-hamburg.de/pipermail/vigra/
6 6
7 diff --git a/src/impex/png.cxx b/src/impex/png.cxx 7 diff --git a/src/impex/png.cxx b/src/impex/png.cxx
8 index 23786ef..6d0b012 100644 8 index 23786ef..08822bd 100644
9 --- a/src/impex/png.cxx 9 --- a/src/impex/png.cxx
10 +++ b/src/impex/png.cxx 10 +++ b/src/impex/png.cxx
11 @@ -320,7 +320,7 @@ namespace vigra { 11 @@ -320,7 +320,11 @@ namespace vigra {
12 #if (PNG_LIBPNG_VER > 10008) && defined(PNG_READ_iCCP_SUPPORTED) 12 #if (PNG_LIBPNG_VER > 10008) && defined(PNG_READ_iCCP_SUPPORTED)
13 char * dummyName; 13 char * dummyName;
14 int dummyCompType; 14 int dummyCompType;
15 - char * profilePtr; 15 +#if (PNG_LIBPNG_VER < 10500)
16 char * profilePtr;
17 +#else
16 + png_byte * profilePtr; 18 + png_byte * profilePtr;
19 +#endif
17 png_uint_32 profileLen; 20 png_uint_32 profileLen;
18 if (png_get_valid( png, info, PNG_INFO_iCCP )) { 21 if (png_get_valid( png, info, PNG_INFO_iCCP )) {
19 png_get_iCCP(png, info, &dummyName, &dummyCompType, &profilePtr, &profileLen) ; 22 png_get_iCCP(png, info, &dummyName, &dummyCompType, &profilePtr, &profileLen) ;
20 @@ -592,7 +592,7 @@ namespace vigra { 23 @@ -592,7 +596,11 @@ namespace vigra {
21 // set icc profile 24 // set icc profile
22 if (iccProfile.size() > 0) { 25 if (iccProfile.size() > 0) {
23 png_set_iCCP(png, info, (png_charp)("icc"), 0, 26 png_set_iCCP(png, info, (png_charp)("icc"), 0,
24 - (png_charp)iccProfile.begin(), (png_uint_32)iccProfile.size()); 27 +#if (PNG_LIBPNG_VER < 10500)
28 (png_charp)iccProfile.begin(), (png_uint_32)iccProfile.size());
29 +#else
25 + (png_byte*)iccProfile.begin(), (png_uint_32)iccProfile.size()); 30 + (png_byte*)iccProfile.begin(), (png_uint_32)iccProfile.size());
31 +#endif
26 } 32 }
27 #endif 33 #endif
28 34