[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
[PATCH] Make PNG image support compatible with modern libpng library
From: Daniel ####@####.#### Date: 24 Mar 2015 10:50:13 -0000 Message-Id: <1427194182-9494-1-git-send-email-daniel.nystrom@timeterminal.se> It was never intended for png_struct to expose it's members, and now it is fully hidden. So to get the io_ptr we have to use the png_get_io_ptr() helper function to maintain compatibility. Signed-off-by: Daniel Nyström ####@####.#### --- src/engine/image_png.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/image_png.c b/src/engine/image_png.c index 2212531..781b5b5 100644 --- a/src/engine/image_png.c +++ b/src/engine/image_png.c @@ -32,7 +32,7 @@ static void png_read_buffer(png_structp pstruct, png_bytep pointer, png_size_t size) { - GdImageBufferRead(pstruct->io_ptr, pointer, size); + GdImageBufferRead(png_get_io_ptr(pstruct), pointer, size); } PSD -- 1.9.1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [PATCH] Make PNG image support compatible with modern libpng library
From: LM ####@####.#### Date: 24 Mar 2015 13:48:21 -0000 Message-Id: <CAFipMOHiJU2Q=_+_d2asQoKeh8tgaiqE_o4tETyC46QmjsYycg@mail.gmail.com> Wouldn't it be safer to use something like the following code, just in case some users are still working with an old version of libpng? That way it works for everyone. #if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 GdImageBufferRead(png_get_io_ptr(pstruct), pointer, size); #else GdImageBufferRead(pstruct->io_ptr, pointer, size); #endif | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |