Opened 14 years ago
Closed 13 years ago
#1347 closed defect (fixed)
r.out.png uses now hidden libpng structs
Reported by: | kyngchaos | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 6.4.2 |
Component: | Raster | Version: | 6.4.1 |
Keywords: | png | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Just my luck - I upgrade to libpng 1.5 after the GRASS 6.4.1 release.
libpng 1.5 does not include the png_info struct (and others) in the png.h header, it's now in a private pnginfo.h. r.out.png needs this. I didn't see any option in libpng compilation to install these new headers.
Compilation fails with
r.out.png.c: In function ‘main’: r.out.png.c:264: error: dereferencing pointer to incomplete type r.out.png.c:265: error: dereferencing pointer to incomplete type r.out.png.c:266: error: dereferencing pointer to incomplete type r.out.png.c:306: error: dereferencing pointer to incomplete type r.out.png.c:308: error: dereferencing pointer to incomplete type
Note also that png.h does not include zlib.h now (as the #include png.h in pngfunc.h currently says). I didn't get an error about this in r.out.png (yet), but I have had an error in other projects.
The png driver didn't have any errors.
Change History (10)
comment:1 by , 14 years ago
follow-up: 4 comment:2 by , 14 years ago
oops, the fns in the last msg were already taken care of in grass source.
as for moving png_info from png.h to pnginfo.h, see changelog starting
I guess we need to set up some #ifdefs based on
PNG_LIBPNG_VER_MAJOR == 1
and PNG_LIBPNG_VER_MINOR >= 5
but I'm not sure how the libpng15 version should look yet.
Hamish
comment:3 by , 14 years ago
I was generalizing the version to imply it was a major version upgrade, 1.5.x. But yes, I do have 1.5.2.
Maybe for a quick fix I could #include that pnginfo.h from my libpng source just to get r.out.png compiled?
follow-up: 5 comment:4 by , 14 years ago
Replying to hamish:
I guess we need to set up some #ifdefs based on
PNG_LIBPNG_VER_MAJOR == 1
andPNG_LIBPNG_VER_MINOR >= 5
I think that we should just switch to using the new API. I doubt that anyone is still using libpng 0.9x.
follow-up: 6 comment:5 by , 14 years ago
Replying to glynn:
I think that we should just switch to using the new API. I doubt that anyone is still using libpng 0.9x.
actually all the 0.9x stuff is already "#ifdef OLDPNG"'d out.
the trouble in this bug is libpng taking formerly public header files and making them private in various stages between versions 1.3 and 1.5. (afaiu)
Hamish
comment:6 by , 14 years ago
Replying to hamish:
the trouble in this bug is libpng taking formerly public header files and making them private in various stages between versions 1.3 and 1.5. (afaiu)
The only header we use is <png.h>. The issue is that the structure definitions have finally been removed from png.h, so applications need to use the appropriate functions rather than manipulating structure fields directly or allocating the structures as local variables.
There shouldn't be any need for conditional compilation (#ifdef). The new (non-deprecated) API has been around long enough that we can take it for granted.
follow-up: 8 comment:7 by , 13 years ago
Version: | 6.4.0 → 6.4.1 |
---|
I just ran into this issue, trying to build 6.4.1 for Fedora rawhide, that also has libpng 1.5. Is there a quick fix I could use?
comment:8 by , 13 years ago
comment:10 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to kyngchaos:
apparently 1.5.0 was buggy, make sure you have 1.5.1+.
http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt
Hamish