libpng 1.5.x compatibility
This commit is contained in:
parent
fa6eb983af
commit
4196bcd1e0
2 changed files with 11 additions and 3 deletions
|
@ -20,6 +20,9 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef MAPNIK_PNG_IO_HPP
|
||||
#define MAPNIK_PNG_IO_HPP
|
||||
|
||||
//$Id$
|
||||
#include <mapnik/global.hpp>
|
||||
#include <mapnik/octree.hpp>
|
||||
|
@ -82,9 +85,11 @@ namespace mapnik {
|
|||
if (!info_ptr)
|
||||
{
|
||||
png_destroy_write_struct(&png_ptr,(png_infopp)0);
|
||||
std::clog << "error writing png\n";
|
||||
return;
|
||||
}
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
jmp_buf* jmp_context = (jmp_buf*) png_get_error_ptr(png_ptr);
|
||||
if (jmp_context)
|
||||
{
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
return;
|
||||
|
@ -233,7 +238,8 @@ namespace mapnik {
|
|||
png_destroy_write_struct(&png_ptr,(png_infopp)0);
|
||||
return;
|
||||
}
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
jmp_buf* jmp_context = (jmp_buf*) png_get_error_ptr(png_ptr);
|
||||
if (jmp_context)
|
||||
{
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
return;
|
||||
|
@ -532,3 +538,5 @@ namespace mapnik {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MAPNIK_PNG_IO_HPP
|
|
@ -82,7 +82,7 @@ namespace mapnik
|
|||
{
|
||||
png_size_t check;
|
||||
check = (png_size_t)fread(data, (png_size_t)1, length,
|
||||
(FILE *)png_ptr->io_ptr);
|
||||
(FILE *)png_get_io_ptr(png_ptr));
|
||||
|
||||
if (check != length)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue