Fix build with png-1.5.

All fixes by yours truly.
This commit is contained in:
naddy 2011-07-08 20:38:00 +00:00
parent 60eda5f2ee
commit eed7c62887
91 changed files with 1801 additions and 42 deletions

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_celengine_image_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/celengine/image.cpp.orig Tue Jul 5 18:05:10 2011
+++ src/celengine/image.cpp Tue Jul 5 18:05:23 2011
@@ -737,7 +737,7 @@ Image* LoadPNGImage(const string& filename)
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
{
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
}
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_celestia_imagecapture_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
--- src/celestia/imagecapture.cpp.orig Tue Jul 5 18:11:09 2011
+++ src/celestia/imagecapture.cpp Tue Jul 5 18:11:26 2011
@@ -29,6 +29,7 @@ extern "C" {
#include "../celestia/Celestia.app.skel/Contents/Frameworks/Headers/png.h"
#else
#include "png.h"
+#include <zlib.h>
#endif
// Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_ui_pixbuf_save_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/ui_pixbuf_save.c.orig Tue Jul 5 23:51:13 2011
+++ src/ui_pixbuf_save.c Tue Jul 5 23:51:48 2011
@@ -86,7 +86,7 @@ gboolean pixbuf_to_file_as_png (GdkPixbuf *pixbuf, cha
return FALSE;
}
- if (setjmp (png_ptr->jmpbuf))
+ if (setjmp (png_jmpbuf (png_ptr)))
{
png_destroy_write_struct (&png_ptr, &info_ptr);
fclose (handle);

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-xwin_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- xwin.c.orig Wed Jul 6 15:44:07 2011
+++ xwin.c Wed Jul 6 15:44:25 2011
@@ -277,7 +277,7 @@ int write_png(int which,const char *filename)
fclose(f);
return 1;
}
- if (setjmp(pp->jmpbuf)) {
+ if (setjmp(png_jmpbuf(pp))) {
png_destroy_write_struct(&pp,&ip);
fclose(f);
gdk_image_destroy(image);

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-src_fxpngio_cpp,v 1.1 2011/07/08 20:38:02 naddy Exp $
Fix build with png-1.5.
--- src/fxpngio.cpp.orig Mon Jul 4 22:42:45 2011
+++ src/fxpngio.cpp Mon Jul 4 22:49:30 2011
@@ -75,7 +75,7 @@ static void user_flush_fn(png_structp ){ }
static void user_error_fn(png_structp png_ptr,png_const_charp){
FXStream* store=(FXStream*)png_get_error_ptr(png_ptr);
store->setError(FXStreamFormat); // Flag this as a format error in FXStream
- longjmp(png_ptr->jmpbuf,1); // Bail out
+ png_longjmp(png_ptr,1); // Bail out
}
@@ -118,7 +118,7 @@ bool fxloadPNG(FXStream& store,FXColor*& data,FXint& w
}
// Set error handling
- if(setjmp(png_ptr->jmpbuf)){
+ if(setjmp(png_jmpbuf(png_ptr))){
// Free all of the memory associated with the png_ptr and info_ptr
png_destroy_read_struct(&png_ptr,&info_ptr,(png_infopp)NULL);
@@ -231,7 +231,7 @@ bool fxsavePNG(FXStream& store,const FXColor* data,FXi
}
// Set error handling.
- if(setjmp(png_ptr->jmpbuf)){
+ if(setjmp(png_jmpbuf(png_ptr))){
png_destroy_write_struct(&png_ptr,&info_ptr);
return false;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_af_util_xp_ut_png_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/af/util/xp/ut_png.cpp.orig Wed Jul 6 18:19:51 2011
+++ src/af/util/xp/ut_png.cpp Wed Jul 6 18:20:08 2011
@@ -71,7 +71,7 @@ bool UT_PNG_getDimensions(const UT_ByteBuf* pBB, UT_si
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, static_cast<png_infopp>(NULL));

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_wp_impexp_gtk_ie_impGraphic_GdkPixbuf_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp.orig Wed Jul 6 18:57:20 2011
+++ src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp Wed Jul 6 18:58:03 2011
@@ -185,7 +185,7 @@ UT_Error IE_ImpGraphic_GdkPixbuf::importGraphic(UT_Byt
/** needed for the stejmp context */
UT_Error IE_ImpGraphic_GdkPixbuf::_png_write(GdkPixbuf * pixbuf)
{
- if (setjmp(m_pPNG->jmpbuf))
+ if (setjmp(png_jmpbuf(m_pPNG)))
{
DELETEP(m_pPngBB);
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
@@ -446,7 +446,7 @@ UT_Error IE_ImpGraphic_GdkPixbuf::Initialize_PNG(void)
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if (setjmp(m_pPNG->jmpbuf))
+ if (setjmp(png_jmpbuf(m_pPNG)))
{
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_image_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/image.c.orig Tue Jul 5 21:14:44 2011
+++ src/image.c Tue Jul 5 21:16:27 2011
@@ -6427,7 +6427,7 @@ my_png_error (png_ptr, msg)
{
xassert (png_ptr != NULL);
image_error ("PNG error: %s", build_string (msg), Qnil);
- longjmp (png_ptr->jmpbuf, 1);
+ png_longjmp (png_ptr, 1);
}
@@ -6603,7 +6603,7 @@ png_load (f, img)
/* Set error jump-back. We come back here when the PNG library
detects an error. */
- if (setjmp (png_ptr->jmpbuf))
+ if (setjmp (png_jmpbuf(png_ptr)))
{
error:
if (png_ptr)

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-screenshot_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
--- screenshot.c.orig Tue Jul 5 23:21:29 2011
+++ screenshot.c Tue Jul 5 23:21:41 2011
@@ -49,6 +49,7 @@
#ifdef USE_LIBPNG
#include <png.h>
+#include <zlib.h>
static int get_rgb32_data( libspectrum_byte *rgb32_data, size_t stride,
size_t height, size_t width );

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_Util_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/Util.cpp.orig Tue Jul 5 21:18:42 2011
+++ src/Util.cpp Tue Jul 5 21:19:02 2011
@@ -79,7 +79,7 @@ bool utilWritePNGFile(const char *fileName, int w, int
return false;
}
- if(setjmp(png_ptr->jmpbuf)) {
+ if(setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr,NULL);
fclose(fp);
return false;

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_zip_zpng_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/zip/zpng.c.orig Wed Jul 6 11:41:15 2011
+++ src/zip/zpng.c Wed Jul 6 11:41:26 2011
@@ -83,8 +83,6 @@ int Png_Dump(const char * filename, unsigned short wid
8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
- info_ptr->color_type=PNG_COLOR_TYPE_RGB_ALPHA;
-
/*Allocate an array of scanline pointers*/
row_pointers=(png_bytep*)malloc(height*sizeof(png_bytep));
for (i=0;i<height;i++)

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-Source_Files_RenderOther_IMG_savepng_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- Source_Files/RenderOther/IMG_savepng.c.orig Tue Jul 5 16:45:04 2011
+++ Source_Files/RenderOther/IMG_savepng.c Tue Jul 5 16:45:58 2011
@@ -29,6 +29,7 @@
#include <SDL/SDL.h>
#include <SDL/SDL_byteorder.h>
#include <png.h>
+#include <zlib.h>
#include "IMG_savepng.h"
int IMG_SavePNG(const char *file, SDL_Surface *surf,int compression, struct IMG_PNG_text* text, int num_text){
@@ -85,7 +86,7 @@ int IMG_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,i
goto savedone;
}
/* setup custom writer functions */
- png_set_write_fn(png_ptr,(voidp)src,png_write_data,NULL);
+ png_set_write_fn(png_ptr,src,png_write_data,NULL);
if (setjmp(png_jmpbuf(png_ptr))){
SDL_SetError("Unknown error writing PNG");

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-src_loadpng_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/loadpng.cpp.orig Wed Jul 6 14:42:57 2011
+++ src/loadpng.cpp Wed Jul 6 14:44:02 2011
@@ -6,6 +6,7 @@
#include <png.h>
+#include <zlib.h>
#include <allegro.h>
#include <allegro/internal/aintern.h>
#include "loadpng.h"
@@ -276,7 +277,7 @@ BITMAP *load_png_pf(PACKFILE *fp, RGB *pal)
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
/* If we get here, we had a problem reading the file */
@@ -372,7 +373,7 @@ BITMAP *load_memory_png(AL_CONST void *buffer, int buf
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
/* If we get here, we had a problem reading the file */
@@ -644,7 +645,7 @@ static int really_save_png(PACKFILE *fp, BITMAP *bmp,
goto Error;
/* Set error handling. */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* If we get here, we had a problem reading the file. */
goto Error;
}

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-gtk-v2_src_png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- gtk-v2/src/png.c.orig Wed Jul 6 11:52:19 2011
+++ gtk-v2/src/png.c Wed Jul 6 11:55:31 2011
@@ -508,7 +508,7 @@ int png_to_gdkpixmap(GdkWindow *window, uint8 *data, i
static uint8 *pixels=NULL;
static int pixels_byte=0, rows_byte=0;
static png_bytepp rows=NULL;
- unsigned long width, height;
+ unsigned width, height;
png_structp png_ptr;
png_infop info_ptr;
int bit_depth, color_type, interlace_type, compression_type, filter_type,
@@ -532,7 +532,7 @@ int png_to_gdkpixmap(GdkWindow *window, uint8 *data, i
png_destroy_read_struct (&png_ptr, NULL, NULL);
return PNGX_OUTOFMEM;
}
- if (setjmp (png_ptr->jmpbuf)) {
+ if (setjmp (png_jmpbuf(png_ptr))) {
png_destroy_read_struct (&png_ptr, &info_ptr,NULL);
return PNGX_DATA;
}

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-x11_png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- x11/png.c.orig Wed Jul 6 11:46:43 2011
+++ x11/png.c Wed Jul 6 11:47:32 2011
@@ -88,7 +88,7 @@ uint8 *png_to_data(unsigned char *data, int len, int *
png_destroy_read_struct (&png_ptr, NULL, NULL);
return NULL;
}
- if (setjmp (png_ptr->jmpbuf)) {
+ if (setjmp (png_jmpbuf (png_ptr))) {
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return NULL;
}
@@ -600,7 +600,7 @@ int png_to_xpixmap(Display *display, Drawable draw, un
png_destroy_read_struct (&png_ptr, NULL, NULL);
return PNGX_OUTOFMEM;
}
- if (setjmp (png_ptr->jmpbuf)) {
+ if (setjmp (png_jmpbuf (png_ptr))) {
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return PNGX_DATA;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-lib-src_enigma-core_IMG_SavePNG_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- lib-src/enigma-core/IMG_SavePNG.c.orig Tue Jul 5 17:25:44 2011
+++ lib-src/enigma-core/IMG_SavePNG.c Tue Jul 5 17:26:11 2011
@@ -84,7 +84,7 @@ int IMG_SavePNG_RW(SDL_Surface *face, SDL_RWops *src)
png_bytep *row_pointers = 0;
/* Set error handling. */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
IMG_SetError("Error writing the PNG file");
}
else {

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-win32_pngtoico_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- win32/pngtoico.c.orig Tue Jul 5 23:12:57 2011
+++ win32/pngtoico.c Tue Jul 5 23:13:37 2011
@@ -188,7 +188,7 @@ read_png(const char *file)
goto perrexit;
}
- if ( setjmp(png_ptr->jmpbuf) ) {
+ if ( setjmp(png_jmpbuf(png_ptr)) ) {
fprintf(stderr, "%s: PNG format error\n", file);
goto errexit;
}

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_IMG_savepng_cpp,v 1.1 2011/07/08 20:38:02 naddy Exp $
Fix build with png-1.5.
--- src/IMG_savepng.cpp.orig Tue Jul 5 15:57:25 2011
+++ src/IMG_savepng.cpp Tue Jul 5 15:57:56 2011
@@ -27,6 +27,7 @@
#ifdef IMPLEMENT_SAVE_PNG
#include <png.h>
+#include <zlib.h>
#endif
#include <stdlib.h>
@@ -131,7 +132,7 @@ int IMG_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,i
goto savedone;
}
/* setup custom writer functions */
- png_set_write_fn(png_ptr,(voidp)src,png_write_data,NULL);
+ png_set_write_fn(png_ptr,src,png_write_data,NULL);
if (setjmp(png_jmpbuf(png_ptr))){
SDL_SetError("Unknown error writing PNG");

View File

@ -1,9 +1,10 @@
$OpenBSD: patch-src_Core_Materials_OOPNGTextureLoader_m,v 1.1 2011/01/15 10:13:23 sebastia Exp $
$OpenBSD: patch-src_Core_Materials_OOPNGTextureLoader_m,v 1.2 2011/07/08 20:38:01 naddy Exp $
missing header
* Missing header.
* Fix build with png-1.5.
--- src/Core/Materials/OOPNGTextureLoader.m.orig Fri Jan 14 12:58:52 2011
+++ src/Core/Materials/OOPNGTextureLoader.m Fri Jan 14 12:59:09 2011
--- src/Core/Materials/OOPNGTextureLoader.m.orig Mon Sep 21 12:53:30 2009
+++ src/Core/Materials/OOPNGTextureLoader.m Tue Jul 5 17:06:57 2011
@@ -50,6 +50,9 @@ SOFTWARE.
#import "OOFunctionAttributes.h"
#import "OOLogging.h"
@ -14,3 +15,21 @@ missing header
void png_error(png_structp, png_const_charp) NO_RETURN_FUNC;
@@ -242,7 +245,7 @@ static void PNGError(png_structp png, png_const_charp
{
OOPNGTextureLoader *loader = nil;
- loader = png->error_ptr;
+ loader = png_get_error_ptr(png);
OOLog(@"texture.load.png.error", @"***** A PNG loading error occurred for %@: %s", [loader path], message);
}
@@ -251,7 +254,7 @@ static void PNGWarning(png_structp png, png_const_char
{
OOPNGTextureLoader *loader = nil;
- loader = png->error_ptr;
+ loader = png_get_error_ptr(png);
OOLog(@"texture.load.png.warning", @"***** A PNG loading warning occurred for %@: %s", [loader path], message);
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_screenshot_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/screenshot.cpp.orig Tue Jul 5 18:02:06 2011
+++ src/screenshot.cpp Tue Jul 5 18:02:25 2011
@@ -159,7 +159,7 @@ Screenshot::save_png(const std::string& filename, uint
return;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
// If we get here, we had a problem reading the file
fclose(fp);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_m_misc_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/m_misc.c.orig Wed Jul 6 12:26:31 2011
+++ src/m_misc.c Wed Jul 6 12:26:57 2011
@@ -1041,7 +1041,7 @@ static void WritePNGfile(FILE* fp, const byte* data,
png_infop info_ptr;
boolean gl = !palette;
- png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, png_error_ptr_NULL, error_fn, NULL);
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, error_fn, NULL);
png_set_compression_level(png_ptr, 2);
if (png_ptr == NULL) { screenshot_write_error = true; return; }
info_ptr = png_create_info_struct(png_ptr);
@@ -1067,7 +1067,7 @@ static void WritePNGfile(FILE* fp, const byte* data,
png_write_end(png_ptr, info_ptr);
}
- png_destroy_write_struct(&png_ptr, png_infopp_NULL);
+ png_destroy_write_struct(&png_ptr, NULL);
}
#else /* HAVE_LIBPNG */

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-src_common_image_ImagePng_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/common/image/ImagePng.cpp.orig Wed Jul 6 17:27:07 2011
+++ src/common/image/ImagePng.cpp Wed Jul 6 17:28:23 2011
@@ -150,7 +150,7 @@ struct user_read_struct
static void user_png_error(png_structp png_ptr, png_const_charp msg)
{
- longjmp(png_ptr->jmpbuf,1);
+ png_longjmp(png_ptr,1);
}
static void user_png_warning(png_structp png_ptr, png_const_charp msg)
@@ -189,7 +189,7 @@ bool ImagePng::loadFromBuffer(NetBuffer &buffer, bool
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL)
{
- png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
+ png_destroy_read_struct(&png_ptr, NULL, NULL);
return false;
}
@@ -200,7 +200,7 @@ bool ImagePng::loadFromBuffer(NetBuffer &buffer, bool
if (setjmp(png_jmpbuf(png_ptr)))
{
/* Free all of the memory associated with the png_ptr and info_ptr */
- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
/* If we get here, we had a problem reading the file */
return false;
}
@@ -258,7 +258,7 @@ bool ImagePng::loadFromBuffer(NetBuffer &buffer, bool
}
else
{
- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
Logger::log(S3D::formatStringBuffer(
"Invalid PNG format.\n"
@@ -272,7 +272,7 @@ bool ImagePng::loadFromBuffer(NetBuffer &buffer, bool
// END NEW CODE
/* clean up after the read, and free any memory allocated - REQUIRED */
- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
/* that's it */
return true;

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_shared_images_c,v 1.1 2011/07/08 20:38:02 naddy Exp $
--- src/shared/images.c.orig Tue Jul 5 16:26:58 2011
+++ src/shared/images.c Tue Jul 5 16:27:19 2011
@@ -32,6 +32,7 @@
#include <jpeglib.h>
#include <png.h>
+#include <zlib.h>
/** image formats, tried in this order */
static char *IMAGE_TYPES[] = { "tga", "png", "jpg", NULL };

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_graphic_surface_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
--- src/graphic/surface.cpp.orig Tue Jul 5 16:31:24 2011
+++ src/graphic/surface.cpp Tue Jul 5 16:31:36 2011
@@ -25,6 +25,7 @@
#include <SDL_image.h>
#include <SDL_rotozoom.h>
#include <png.h>
+#include <zlib.h>
#include "graphic/surface.h"
#include "tool/math_tools.h"

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_loadpng_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/loadpng.c.orig Wed Jul 6 15:26:00 2011
+++ src/loadpng.c Wed Jul 6 15:28:42 2011
@@ -73,7 +73,7 @@ unsigned char * load_png_file( const char *file,
return NULL;
}
/* libpng does a longjmp here when it encounters an error */
- if ( setjmp( png_ptr->jmpbuf ) ) {
+ if ( setjmp( png_jmpbuf( png_ptr ) ) ) {
png_destroy_read_struct( &png_ptr, &info_ptr, NULL);
fclose(fd);
return NULL;
@@ -95,7 +95,7 @@ unsigned char * load_png_file( const char *file,
png_set_gray_to_rgb(png_ptr);
/* detect alpha layer */
- if (( info_ptr->color_type & PNG_COLOR_MASK_ALPHA )||
+ if (( png_get_color_type ( png_ptr, info_ptr ) & PNG_COLOR_MASK_ALPHA )||
( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS )))
*has_alpha = 1;
else

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 2010/11/16 11:23:29 espie Exp $
# $OpenBSD: Makefile,v 1.8 2011/07/08 20:38:02 naddy Exp $
COMMENT = challenging 2D motocross platform game
@ -37,7 +37,8 @@ LIB_DEPENDS = devel/sdl-mixer \
USE_GMAKE = Yes
USE_GROFF = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include \
-I${LOCALBASE}/include/libpng" \
LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" \
LIBS="-lGL -lm -pthread"

View File

@ -1,12 +1,20 @@
$OpenBSD: patch-src_image_tim_png_cpp,v 1.1.1.1 2009/08/03 14:16:26 jasper Exp $
--- src/image/tim_png.cpp.orig Sat Dec 6 01:05:28 2008
+++ src/image/tim_png.cpp Sat Dec 6 01:06:44 2008
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#include <stdio.h>
$OpenBSD: patch-src_image_tim_png_cpp,v 1.2 2011/07/08 20:38:02 naddy Exp $
--- src/image/tim_png.cpp.orig Mon Jul 13 13:41:39 2009
+++ src/image/tim_png.cpp Mon Jul 4 23:24:32 2011
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#include <string.h>
#include "tim.h"
-#include "png.h"
+#include <libpng/png.h>
#include "png.h"
+#include <zlib.h>
/*==============================================================================
Types
@@ -166,7 +167,7 @@ int tim_png_load(tim_session_t *pSession,tim_image_t *
png_set_palette_to_rgb(PngPtr);
if(nColorType==PNG_COLOR_TYPE_GRAY && nBitDepth<8)
- png_set_gray_1_2_4_to_8(PngPtr);
+ png_set_expand_gray_1_2_4_to_8(PngPtr);
if(png_get_valid(PngPtr,InfoPtr,PNG_INFO_tRNS))
png_set_tRNS_to_alpha(PngPtr);

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.3 2011/03/30 09:50:53 jasper Exp $
# $OpenBSD: Makefile,v 1.4 2011/07/08 20:38:01 naddy Exp $
COMMENT= library for powerful image loading capabilities
DISTNAME= DevIL-1.7.8
REVISION= 1
REVISION= 2
SHARED_LIBS+= IL 0.0 # 2.0
CATEGORIES= graphics devel

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src-IL_src_il_icon_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix for png-1.5.
--- src-IL/src/il_icon.c.orig Wed Jul 6 15:09:04 2011
+++ src-IL/src/il_icon.c Wed Jul 6 15:10:14 2011
@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdoub
// Expand low-bit-depth grayscale images to 8 bits
if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_gray_1_2_4_to_8(ico_png_ptr);
+ png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
}
// Expand RGB images with transparency to full alpha channels

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src-IL_src_il_png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix for png-1.5.
--- src-IL/src/il_png.c.orig Wed Jul 6 15:09:12 2011
+++ src-IL/src/il_png.c Wed Jul 6 15:10:26 2011
@@ -278,7 +278,7 @@ ILboolean readpng_get_image(ILdouble display_exponent)
// Expand low-bit-depth grayscale images to 8 bits
if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
}
// Expand RGB images with transparency to full alpha channels

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-src_pngread_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/pngread.c.orig Wed Jul 6 12:21:41 2011
+++ src/pngread.c Wed Jul 6 12:23:21 2011
@@ -69,7 +69,7 @@ value read_png_file_as_rgb24( name )
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
@@ -134,7 +134,7 @@ value read_png_file_as_rgb24( name )
png_set_rows(png_ptr, info_ptr, row_pointers);
/* Later, we can return something */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
@@ -243,7 +243,7 @@ value read_png_file( name )
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
@@ -302,7 +302,7 @@ value read_png_file( name )
png_set_rows(png_ptr, info_ptr, row_pointers);
/* Later, we can return something */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_pngwrite_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/pngwrite.c.orig Wed Jul 6 12:23:50 2011
+++ src/pngwrite.c Wed Jul 6 12:24:20 2011
@@ -62,7 +62,7 @@ value write_png_file_rgb( name, buffer, width, height,
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
@@ -171,7 +171,7 @@ value write_png_file_index( name, buffer, cmap, width,
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_imageio_format_Makefile_in,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/imageio/format/Makefile.in.orig Tue Jul 5 21:06:38 2011
+++ src/imageio/format/Makefile.in Tue Jul 5 21:06:51 2011
@@ -161,7 +161,7 @@ CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@ $(AM_CFLAGS) -I$(srcdir) -I$(srcdir)/../.. -Werror \
+CFLAGS = @CFLAGS@ $(AM_CFLAGS) -I$(srcdir) -I$(srcdir)/../.. \
-g -rdynamic
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_imageio_format_png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
--- src/imageio/format/png.c.orig Tue Jul 5 20:40:09 2011
+++ src/imageio/format/png.c Tue Jul 5 20:40:23 2011
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <png.h>
+#include <zlib.h>
#include <inttypes.h>
DT_MODULE(1)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-plug-ins_libart_export_png_c,v 1.1 2011/07/08 20:38:02 naddy Exp $
--- plug-ins/libart/export_png.c.orig Mon Jul 4 22:35:43 2011
+++ plug-ins/libart/export_png.c Mon Jul 4 22:36:02 2011
@@ -178,7 +178,7 @@ export_png_ok(GtkButton *button, gpointer userdata)
}
/* set error handling ... */
- if (setjmp(png->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png))) {
fclose(fp);
png_destroy_write_struct(&png, &info);
message_error(_("Error occurred while writing PNG"));

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-libffmpegthumbnailer_pngwriter_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- libffmpegthumbnailer/pngwriter.cpp.orig Tue Jul 5 17:36:44 2011
+++ libffmpegthumbnailer/pngwriter.cpp Tue Jul 5 17:37:03 2011
@@ -49,7 +49,7 @@ PngWriter::PngWriter(std::vector<uint8_t>& outputBuffe
, m_InfoPtr(NULL)
{
init();
- png_set_write_fn(m_PngPtr, (voidp) &outputBuffer, writeDataCallback, NULL);
+ png_set_write_fn(m_PngPtr, &outputBuffer, writeDataCallback, NULL);
}
PngWriter::~PngWriter()

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-my_png_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- my_png.cpp.orig Wed Jul 6 15:34:02 2011
+++ my_png.cpp Wed Jul 6 15:34:19 2011
@@ -58,7 +58,7 @@ void save_file(image_info* img, char* filename)
return;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
fprintf(stderr, "Internal error in libpng\n");
if (png_pal)
delete[] png_pal;

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_extension_internal_pdfinput_svg-builder_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/extension/internal/pdfinput/svg-builder.cpp.orig Wed Jul 6 19:01:29 2011
+++ src/extension/internal/pdfinput/svg-builder.cpp Wed Jul 6 19:01:45 2011
@@ -1443,7 +1443,7 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *
return NULL;
}
// Set error handler
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr, &info_ptr);
return NULL;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_helper_png-write_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/helper/png-write.cpp.orig Wed Jul 6 19:28:18 2011
+++ src/helper/png-write.cpp Wed Jul 6 19:28:41 2011
@@ -165,7 +165,7 @@ sp_png_write_rgba_striped(SPDocument *doc,
/* Set error handling. REQUIRED if you aren't supplying your own
* error hadnling functions in the png_create_write_struct() call.
*/
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* If we get here, we had a problem reading the file */
fclose(fp);
png_destroy_write_struct(&png_ptr, &info_ptr);

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_sp-image_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/sp-image.cpp.orig Wed Jul 6 18:23:19 2011
+++ src/sp-image.cpp Wed Jul 6 18:23:45 2011
@@ -388,7 +388,7 @@ static bool readPngAndHeaders( PushPull &youme, gint &
{
char* name = 0;
int compression_type = 0;
- char* profile = 0;
+ png_byte* profile = 0;
png_uint_32 proflen = 0;
if ( png_get_iCCP(pngPtr, infoPtr, &name, &compression_type, &profile, &proflen) ) {
// g_message("Found an iCCP chunk named [%s] with %d bytes and comp %d", name, proflen, compression_type);

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.5 2011/03/25 21:12:28 sthen Exp $
# $OpenBSD: Makefile,v 1.6 2011/07/08 20:38:00 naddy Exp $
SHARED_LIBS += jbig2dec 0.0 # 0.0
@ -27,7 +27,8 @@ LIB_DEPENDS = graphics/png
USE_LIBTOOL = Yes
SEPARATE_BUILD = concurrent
CONFIGURE_STYLE = gnu
AUTOCONF_VERSION = 2.63
CONFIGURE_STYLE = autoconf
CONFIGURE_ARGS = --with-libpng=${LOCALBASE}
CFLAGS += -I${LOCALBASE}/include/libpng
CONFIGURE_ENV = LDFLAGS="`pkg-config --libs libpng`"

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-configure_ac,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- configure.ac.orig Thu Jul 7 08:24:29 2011
+++ configure.ac Thu Jul 7 08:25:16 2011
@@ -45,7 +45,7 @@ if test "x$ac_cv_want_libpng" != "xno"; then
fi
dnl libpng requires pow() which may be in libm
AC_SEARCH_LIBS([pow], [m])
- AC_CHECK_LIB([png], [png_check_sig], [
+ AC_CHECK_LIB([png], [png_create_write_struct], [
AC_CHECK_LIB([z], [deflate], [
AC_DEFINE(HAVE_LIBPNG, 1, [Define if libpng is available (-lpng)])
LIBS="-lpng -lz $LIBS"

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-jbig2_image_png_c,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- jbig2_image_png.c.orig Thu Jul 7 08:44:06 2011
+++ jbig2_image_png.c Thu Jul 7 08:48:07 2011
@@ -33,7 +33,7 @@ jbig2_png_write_data(png_structp png_ptr, png_bytep da
{
png_size_t check;
- check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
+ check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
if (check != length) {
png_error(png_ptr, "Write Error");
}
@@ -43,7 +43,7 @@ static void
jbig2_png_flush(png_structp png_ptr)
{
png_FILE_p io_ptr;
- io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
+ io_ptr = (png_FILE_p)png_get_io_ptr(png_ptr);
if (io_ptr != NULL)
fflush(io_ptr);
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-kipi-plugins_rawconverter_rawdecodingiface_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- kipi-plugins/rawconverter/rawdecodingiface.cpp.orig Tue Jul 5 16:50:40 2011
+++ kipi-plugins/rawconverter/rawdecodingiface.cpp Tue Jul 5 16:50:58 2011
@@ -299,7 +299,7 @@ bool RawDecodingIface::loadedFromDcraw(const QString&
if (!ICCColorProfile.isEmpty())
{
png_set_iCCP(png_ptr, info_ptr, "icc", PNG_COMPRESSION_TYPE_BASE,
- ICCColorProfile.data(), ICCColorProfile.size());
+ (png_byte *)ICCColorProfile.data(), ICCColorProfile.size());
}
QString libpngver(PNG_HEADER_VERSION_STRING);

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_png_reader_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/png_reader.cpp.orig Tue Jul 5 18:18:28 2011
+++ src/png_reader.cpp Tue Jul 5 18:18:53 2011
@@ -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)
{

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-src_ImageData_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/ImageData.cpp.orig Tue Jul 5 21:52:52 2011
+++ src/ImageData.cpp Tue Jul 5 21:56:08 2011
@@ -370,6 +370,7 @@ bool ImageData::pngLoadPNGLib (const string& filename)
char sig[8]; /* PNG signature array */
+ unsigned int w, h;
int bit_depth;
int color_type;
@@ -454,8 +455,10 @@ bool ImageData::pngLoadPNGLib (const string& filename)
// read all the info up to the image data
png_read_info(png_ptr, info_ptr);
- png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
+ png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth,
&color_type, NULL, NULL, NULL);
+ width = w;
+ height = h;
// Set up some transforms.
if (color_type & PNG_COLOR_MASK_ALPHA)

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-tiff2png_c,v 1.1 2011/07/08 20:38:00 naddy Exp $
--- tiff2png.c.orig Wed Jul 6 17:43:46 2011
+++ tiff2png.c Wed Jul 6 17:45:03 2011
@@ -87,6 +87,7 @@
# include "tiffcomp.h" /* not installed by default */
#endif
#include "png.h"
+#include <zlib.h>
#ifdef _MSC_VER /* works for MSVC 5.0; need finer tuning? */
# define strcasecmp _stricmp
@@ -817,7 +818,7 @@ tiff2png (tiffname, pngname, verbose, force, interlace
res_x = res_x_half;
if (verbose)
{
- fprintf (stderr, "tiff2png: new width = %lu pixels\n", width);
+ fprintf (stderr, "tiff2png: new width = %u pixels\n", width);
fprintf (stderr, "tiff2png: new color type = paletted\n");
fprintf (stderr, "tiff2png: new bit depth = %d\n", bit_depth);
}

View File

@ -0,0 +1,58 @@
$OpenBSD: patch-source_m-png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- source/m-png.c.orig Tue Jul 5 17:14:51 2011
+++ source/m-png.c Tue Jul 5 17:19:24 2011
@@ -65,7 +65,7 @@ static void MdcPngErr(png_structp png_ptr, png_const_c
if (!png_ptr) return;
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
static void MdcPngWarn(png_structp png_ptr, png_const_charp warning_msg)
@@ -95,11 +95,12 @@ char *MdcReadPNG(FILEINFO *fi)
{
png_structp png_ptr;
png_infop info_ptr;
+ png_textp text_ptr;
png_uint_32 width, height, rowbytes;
png_colorp palette;
png_bytepp row_pointers;
Uint32 i, commentsize;
- int bit_depth, color_type, transform, num_palette;
+ int bit_depth, color_type, transform, num_palette, num_text;
Uint8 *imgRGB, *pbuf;
IMG_DATA *id;
@@ -161,21 +162,21 @@ char *MdcReadPNG(FILEINFO *fi)
}
/* get comment */
- if(info_ptr->num_text > 0) {
+ if(png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) > 0) {
commentsize = 1;
- for(i = 0; i < info_ptr->num_text; i++)
- commentsize += strlen(info_ptr->text[i].key) + 1 +
- info_ptr->text[i].text_length + 2;
+ for(i = 0; i < num_text; i++)
+ commentsize += strlen(text_ptr[i].key) + 1 +
+ text_ptr[i].text_length + 2;
if ((fi->comment = malloc(commentsize)) == NULL) {
MdcPngWarn(png_ptr,"PNG Can't malloc comment string");
}else{
fi->comment[0] = '\0';
- for (i = 0; i < info_ptr->num_text; i++) {
- strcat(fi->comment, info_ptr->text[i].key);
+ for (i = 0; i < num_text; i++) {
+ strcat(fi->comment, text_ptr[i].key);
strcat(fi->comment, "::");
- strcat(fi->comment, info_ptr->text[i].text);
+ strcat(fi->comment, text_ptr[i].text);
strcat(fi->comment, "\n");
}
}

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-image_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- image.c.orig Wed Jul 6 17:22:24 2011
+++ image.c Wed Jul 6 17:22:58 2011
@@ -439,13 +439,13 @@ png_uint_32 ww, hh;
fclose(fp);
return NULL;
}
- if(setjmp(png_ptr->jmpbuf))
+ if(setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(fp);
return NULL;
}
- if(info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if(png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(fp);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_xsane-save_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/xsane-save.c.orig Wed Jul 6 11:21:42 2011
+++ src/xsane-save.c Wed Jul 6 11:22:16 2011
@@ -4910,7 +4910,7 @@ int xsane_save_png(FILE *outfile, int compression, FIL
return -1; /* error */
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBPNG);
xsane_back_gtk_error(buf, TRUE);
@@ -5100,7 +5100,7 @@ int xsane_save_png_16(FILE *outfile, int compression,
return -1; /* error */
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBPNG);
xsane_back_gtk_error(buf, TRUE);

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_rstdrv_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/rstdrv.c.orig Wed Jul 6 11:19:00 2011
+++ src/rstdrv.c Wed Jul 6 11:19:34 2011
@@ -54,6 +54,7 @@
#ifdef HAVE_LIBPNG
# include <png.h>
+# include <zlib.h>
#endif
#ifndef NONE_GUI
@@ -885,7 +886,7 @@ static void rstImagePng(gdImagePtr ihandle, FILE *prst
return;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr, &info_ptr);
return;
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-configure_in,v 1.5 2005/11/03 14:46:01 espie Exp $
--- configure.in.orig Tue May 22 08:09:42 2001
+++ configure.in Thu Nov 3 15:00:38 2005
@@ -103,6 +103,8 @@ if test "$mgp_use_freetype" = "yes"; the
$OpenBSD: patch-configure_in,v 1.6 2011/07/08 20:38:00 naddy Exp $
--- configure.in.orig Tue May 22 00:09:42 2001
+++ configure.in Thu Jul 7 09:07:23 2011
@@ -103,6 +103,8 @@ if test "$mgp_use_freetype" = "yes"; then
ac_cv_ft_include="$dir/include"
elif test -d $dir/include/freetype -a -f $dir/include/freetype/freetype.h; then
ac_cv_ft_include="$dir/include/freetype"
@ -10,7 +10,7 @@ $OpenBSD: patch-configure_in,v 1.5 2005/11/03 14:46:01 espie Exp $
fi
if test "$ac_cv_ft_lib" != "no" -a "$ac_cv_ft_include" != "no"; then
LIBS="-L$ac_cv_ft_lib $LIBS"
@@ -118,7 +120,7 @@ if test "$mgp_use_freetype" = "yes"; the
@@ -118,7 +120,7 @@ if test "$mgp_use_freetype" = "yes"; then
fi
fi
if test "$mgp_use_freetype" = "yes"; then
@ -19,7 +19,7 @@ $OpenBSD: patch-configure_in,v 1.5 2005/11/03 14:46:01 espie Exp $
OPTFLAGS="-I$ac_cv_ft_include $OPTFLAGS"
DEPLIBS="$ac_cv_ft_lib/$ac_cv_ft_libpath $DEPLIBS"
AC_CHECK_LIB(intl, dgettext)
@@ -244,7 +246,7 @@ if test "$mgp_use_freetype" = "yes"; the
@@ -244,7 +246,7 @@ if test "$mgp_use_freetype" = "yes"; then
fi
for i in /usr/pkg /usr/local /usr; do
@ -28,7 +28,7 @@ $OpenBSD: patch-configure_in,v 1.5 2005/11/03 14:46:01 espie Exp $
if test -f $i/lib/libpng.a ; then
DEPLIBS="$DEPLIBS $i/lib/libpng.a"
elif test -f $i/lib/libpng.so ; then
@@ -253,7 +255,7 @@ for i in /usr/pkg /usr/local /usr; do
@@ -253,11 +255,11 @@ for i in /usr/pkg /usr/local /usr; do
break;
fi
LIBS="$LIBS -L$i/lib"
@ -37,6 +37,11 @@ $OpenBSD: patch-configure_in,v 1.5 2005/11/03 14:46:01 espie Exp $
AC_CHECK_LIB(png, png_read_image,
[LIBS="$LIBS -lpng"
AC_DEFINE(USE_PNG)],
- [AC_CHECK_LIB(png, png_set_gray_1_2_4_to_8,
+ [AC_CHECK_LIB(png, png_set_expand_gray_1_2_4_to_8,
[LIBS="$LIBS -lpng -lz"
AC_DEFINE(USE_PNG)],
[], [-lz])])
@@ -274,7 +276,7 @@ for i in /usr/pkg /usr/local /usr; do
else
break;

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-image_png_c,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- image/png.c.orig Wed Apr 11 02:37:00 2001
+++ image/png.c Thu Jul 7 09:09:50 2011
@@ -86,7 +86,7 @@ pngLoad(fullname, name, verbose)
return NULL;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
return NULL;
@@ -134,7 +134,7 @@ pngLoad(fullname, name, verbose)
}
if (colortype == PNG_COLOR_TYPE_GRAY && bitdepth < 8){
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
}
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)){

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-parse_c,v 1.1 2005/11/05 09:28:42 espie Exp $
--- parse.c.orig Sat Nov 5 10:15:39 2005
+++ parse.c Sat Nov 5 10:20:57 2005
@@ -355,14 +355,17 @@ read_file(fp, filename, page, line, prea
$OpenBSD: patch-parse_c,v 1.2 2011/07/08 20:38:00 naddy Exp $
--- parse.c.orig Mon Sep 17 08:48:30 2001
+++ parse.c Thu Jul 7 08:59:48 2011
@@ -355,14 +355,17 @@ read_file(fp, filename, page, line, preamble)
case CTL_TAB:
{

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_spuunmux_c,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/spuunmux.c.orig Wed Jul 6 18:17:03 2011
+++ src/spuunmux.c Wed Jul 6 18:17:41 2011
@@ -35,6 +35,7 @@
#include <netinet/in.h>
#include <png.h>
+#include <zlib.h>
#include "rgb.h"
@@ -460,7 +461,7 @@ static int write_png(char *file_name,struct spu *s,str
return -1;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
return -1;

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_blocks_pngdbl_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/blocks/pngdbl.c.orig Tue Jul 5 23:36:18 2011
+++ src/blocks/pngdbl.c Tue Jul 5 23:37:28 2011
@@ -61,7 +61,7 @@ static png_structp openPngFromFile(FILE *fp)
}
static int pngReadFunc(png_structp png, unsigned char *buf, int len)
-{ SWFInput input = (SWFInput) png->io_ptr;
+{ SWFInput input = (SWFInput) png_get_io_ptr(png);
return SWFInput_read(input, buf, len);
}
@@ -127,7 +127,7 @@ static int readPNG(png_structp png_ptr, dblData result
return 0;
}
- if(setjmp(png_ptr->jmpbuf))
+ if(setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
return 0;

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-util_png2dbl_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- util/png2dbl.c.orig Tue Jul 5 23:38:54 2011
+++ util/png2dbl.c Tue Jul 5 23:40:30 2011
@@ -91,7 +91,7 @@ struct pngdata readPNG(FILE *fp)
error("Couldn't create end_info\n");
}
- if(setjmp(png_ptr->jmpbuf))
+ if(setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
fclose(fp);
@@ -108,7 +108,7 @@ struct pngdata readPNG(FILE *fp)
if(verbose)
{
- printf("size %ld/%ld color %d/%d/%ld\n",
+ printf("size %d/%d color %d/%d/%d\n",
png.width, png.height, png.bit_depth, png.color_type,
png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS));
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_xitk_Imlib-light_load_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/xitk/Imlib-light/load.c.orig Wed Jul 6 10:58:51 2011
+++ src/xitk/Imlib-light/load.c Wed Jul 6 11:00:28 2011
@@ -61,7 +61,7 @@ unsigned char *_LoadPNG(ImlibData * id, FILE * f, int
png_destroy_read_struct(&png_ptr, NULL, NULL);
return NULL;
}
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;

View File

@ -1,4 +1,4 @@
#$OpenBSD: Makefile,v 1.17 2011/07/07 13:14:29 jasper Exp $
#$OpenBSD: Makefile,v 1.18 2011/07/08 20:38:00 naddy Exp $
COMMENT= open source MSN Messenger clone
@ -7,6 +7,10 @@ DISTNAME= amsn-$V-src
PKGNAME= ${DISTNAME:S/-src//}
CATEGORIES= net
# CxImage requires access to internal png headers.
# This must be in sync with graphics/png
PNG_V= 1.5.2
HOMEPAGE= http://www.amsn-project.net/
MAINTAINER= Azwaw OUSADOU <bsdmaniak@gmail.com>
@ -32,7 +36,8 @@ RUN_DEPENDS+= ${MODTK_RUN_DEPENDS} \
x11/bwidget \
devel/desktop-file-utils
BUILD_DEPENDS= ${MODTK_BUILD_DEPENDS} \
security/tcltls
security/tcltls \
graphics/png:configure
MODTK_THREADED= Yes
MODULES= devel/gettext \
@ -46,7 +51,8 @@ CONFIGURE_ARGS+=--disable-libv4l \
--with-tcl="${MODTCL_LIBDIR}" \
--with-tk="${MODTK_LIBDIR}"
CONFIGURE_ENV+= CPPFLAGS="-I${X11BASE}/include -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng" \
CONFIGURE_ENV+= CPPFLAGS="-I${X11BASE}/include -I${LOCALBASE}/include \
-I${WRKDIR}/graphics/png/libpng-${PNG_V}" \
LDFLAGS="-lm -L${LOCALBASE}/lib" \
TK_INC_SPEC="${MODTK_INCDIR}/generic" \
TCLSH="${MODTCL_BIN}"

View File

@ -0,0 +1,78 @@
$OpenBSD: patch-utils_TkCximage_src_CxImage_ximapng_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- utils/TkCximage/src/CxImage/ximapng.cpp.orig Thu Jul 7 15:24:08 2011
+++ utils/TkCximage/src/CxImage/ximapng.cpp Thu Jul 7 15:42:35 2011
@@ -15,7 +15,7 @@
void CxImagePNG::ima_png_error(png_struct *png_ptr, char *message)
{
strcpy(info.szLastError,message);
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
////////////////////////////////////////////////////////////////////////////////
#if CXIMAGE_SUPPORT_DECODE
@@ -62,7 +62,7 @@ bool CxImagePNG::Decode(CxFile *hFile)
/* Set error handling if you are using the setjmp/longjmp method (this is
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier. */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
delete [] row_pointers;
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
@@ -80,7 +80,7 @@ bool CxImagePNG::Decode(CxFile *hFile)
head.biWidth = info_ptr->width;
head.biHeight= info_ptr->height;
info.dwType = CXIMAGE_FORMAT_PNG;
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
/* calculate new number of channels */
@@ -101,7 +101,7 @@ bool CxImagePNG::Decode(CxFile *hFile)
break;
default:
strcpy(info.szLastError,"unknown PNG color type");
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
//find the right pixel depth used for cximage
@@ -111,7 +111,7 @@ bool CxImagePNG::Decode(CxFile *hFile)
if (channels >= 3) pixel_depth=24;
if (!Create(info_ptr->width, info_ptr->height, pixel_depth, CXIMAGE_FORMAT_PNG)){
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
/* get metrics */
@@ -207,7 +207,7 @@ bool CxImagePNG::Decode(CxFile *hFile)
}
// <vho> - handle cancel
- if (info.nEscape) longjmp(png_ptr->jmpbuf, 1);
+ if (info.nEscape) png_longjmp(png_ptr, 1);
// row_bytes is the width x number of channels x (bit-depth / 8)
row_pointers = new BYTE[info_ptr->rowbytes + 8];
@@ -230,7 +230,7 @@ bool CxImagePNG::Decode(CxFile *hFile)
do {
// <vho> - handle cancel
- if (info.nEscape) longjmp(png_ptr->jmpbuf, 1);
+ if (info.nEscape) png_longjmp(png_ptr, 1);
#if CXIMAGE_SUPPORT_ALPHA // <vho>
if (AlphaIsValid()) {
@@ -362,7 +362,7 @@ bool CxImagePNG::Encode(CxFile *hFile)
/* Set error handling. REQUIRED if you aren't supplying your own
* error hadnling functions in the png_create_write_struct() call.
*/
- if (setjmp(png_ptr->jmpbuf)){
+ if (setjmp(png_jmpbuf(png_ptr))){
/* If we get here, we had a problem reading the file */
if (info_ptr->palette) free(info_ptr->palette);
png_destroy_write_struct(&png_ptr, (png_infopp)&info_ptr);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-utils_TkCximage_src_CxImage_ximapng_h,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- utils/TkCximage/src/CxImage/ximapng.h.orig Thu Jul 7 15:23:22 2011
+++ utils/TkCximage/src/CxImage/ximapng.h Thu Jul 7 15:39:39 2011
@@ -23,6 +23,8 @@
extern "C" {
#include <png.h>
+#include <pngstruct.h>
+#include <pnginfo.h>
}
class CxImagePNG: public CxImage
@@ -65,7 +67,7 @@ class CxImagePNG: public CxImage (protected)
static void PNGAPI user_error_fn(png_structp png_ptr,png_const_charp error_msg)
{
strncpy((char*)png_ptr->error_ptr,error_msg,255);
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
};

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.5 2011/05/11 12:03:20 jasper Exp $
# $OpenBSD: Makefile,v 1.6 2011/07/08 20:38:01 naddy Exp $
COMMENT = compressing non-caching HTTP proxy
@ -29,7 +29,8 @@ LIB_DEPENDS = graphics/libungif \
SEPARATE_BUILD = concurrent
CONFIGURE_STYLE = gnu
CONFIGURE_STYLE = autoconf
AUTOCONF_VERSION = 2.61
USE_GROFF = Yes
CPPFLAGS = -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-configure_in,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- configure.in.orig Wed Jul 6 16:14:38 2011
+++ configure.in Wed Jul 6 16:14:50 2011
@@ -24,7 +24,7 @@ USE_LIB(jpeg)
AC_CHECK_LIB(jpeg, jpeg_start_decompress,, AC_MSG_ERROR([libjpeg not found.]))
USE_LIB(png)
-AC_CHECK_LIB(png, png_check_sig,, AC_MSG_ERROR([libpng not found.]), -lz -lm)
+AC_CHECK_LIB(png, png_sig_cmp,, AC_MSG_ERROR([libpng not found.]), -lz -lm)
USE_LIB(pthread)
AC_CHECK_LIB(pthread, pthread_create,, AC_MSG_ERROR([libpthread not found.]), -lpthread)

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-src_image_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/image.c.orig Wed Jul 6 16:17:52 2011
+++ src/image.c Wed Jul 6 17:09:51 2011
@@ -27,6 +27,7 @@
#undef GLOBAL
#include <png.h>
+#include <zlib.h>
#ifdef JP2K
#include <jasper/jasper.h>
@@ -407,7 +408,7 @@ int png2bitmap(char *inbuf, int insize, raw_bitmap **o
bmp = new_raw_bitmap();
*out = bmp;
- png_set_read_fn(png_ptr,(voidp)&desc,mem_to_png);
+ png_set_read_fn(png_ptr,&desc,mem_to_png);
png_read_info(png_ptr,info_ptr);
png_get_IHDR(png_ptr,info_ptr,(png_uint_32*)&(bmp->width),
@@ -457,7 +458,7 @@ int png2bitmap(char *inbuf, int insize, raw_bitmap **o
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
{
grayscale=1;
- if(bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
+ if(bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
}else grayscale=0;
if (bit_depth == 16)

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_calibre_ebooks_pdf_images_cpp,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/calibre/ebooks/pdf/images.cpp.orig Wed Jul 6 18:39:44 2011
+++ src/calibre/ebooks/pdf/images.cpp Wed Jul 6 18:41:30 2011
@@ -301,7 +301,7 @@ void PNGWriter::write_splash_bitmap(SplashBitmap *bitm
void calibre_png_mem_write(png_structp png_ptr, png_bytep data, png_size_t length) {
if (!png_ptr || length < 1) return;
- vector<char> *buf = static_cast< vector<char>* >(png_ptr->io_ptr);
+ vector<char> *buf = static_cast< vector<char>* >(png_get_io_ptr(png_ptr));
buf->reserve(buf->capacity() + length);
do {
buf->push_back(static_cast<char>(*data));

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_calibre_ebooks_pdf_images_h,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/calibre/ebooks/pdf/images.h.orig Wed Jul 6 18:40:34 2011
+++ src/calibre/ebooks/pdf/images.h Wed Jul 6 18:40:45 2011
@@ -11,6 +11,7 @@
#include <GfxState.h>
#include <splash/SplashBitmap.h>
#include <png.h>
+#include <zlib.h>
#include <jpeglib.h>
#include "utils.h"

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-third_party_WebKit_Source_WebCore_platform_image-decoders_png_PNGImageDecoder_cpp,v 1.1 2011/07/08 20:38:02 naddy Exp $
--- third_party/WebKit/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp.orig Mon Jul 4 19:52:29 2011
+++ third_party/WebKit/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp Mon Jul 4 19:56:15 2011
@@ -226,7 +226,7 @@ static ColorProfile readColorProfile(png_structp png,
#ifdef PNG_iCCP_SUPPORTED
char* profileName;
int compressionType;
- char* profile;
+ png_byte* profile;
png_uint_32 profileLength;
if (png_get_iCCP(png, info, &profileName, &compressionType, &profile, &profileLength)) {
ColorProfile colorProfile;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-third_party_WebKit_Source_WebCore_platform_image-encoders_skia_PNGImageEncoder_cpp,v 1.1 2011/07/08 20:38:02 naddy Exp $
--- third_party/WebKit/Source/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp.orig Mon Jul 4 21:58:26 2011
+++ third_party/WebKit/Source/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp Mon Jul 4 21:59:44 2011
@@ -44,7 +44,7 @@ namespace WebCore {
static void writeOutput(png_structp png, png_bytep data, png_size_t size)
{
- static_cast<Vector<unsigned char>*>(png->io_ptr)->append(data, size);
+ static_cast<Vector<unsigned char>*>(png_get_io_ptr(png))->append(data, size);
}
static void preMultipliedBGRAtoRGBA(const void* pixels, int pixelCount, unsigned char* output)

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-ui_gfx_codec_png_codec_cc,v 1.1 2011/07/08 20:38:02 naddy Exp $
--- ui/gfx/codec/png_codec.cc.orig Mon Jul 4 15:57:42 2011
+++ ui/gfx/codec/png_codec.cc Mon Jul 4 15:57:54 2011
@@ -15,6 +15,7 @@
extern "C" {
#if defined(USE_SYSTEM_LIBPNG)
#include <png.h>
+#include <zlib.h>
#else
#include "third_party/libpng/png.h"
#endif

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- png.c.orig Wed Jul 6 11:27:06 2011
+++ png.c Wed Jul 6 11:28:03 2011
@@ -48,7 +48,7 @@ void img_my_png_warning(png_structp a, png_const_charp
/* Error for from-web PNG images. */
void img_my_png_error(png_structp png_ptr, png_const_charp error_string)
{
- longjmp(png_ptr->jmpbuf,1);
+ png_longjmp(png_ptr,1);
}
void png_info_callback(png_structp png_ptr, png_infop info_ptr)
@@ -203,7 +203,7 @@ void png_start(struct cached_image *cimg)
#ifdef DEBUG
if (!info_ptr) internal ("png_create_info_struct failed\n");
#endif /* #ifdef DEBUG */
- if (setjmp(png_ptr->jmpbuf)){
+ if (setjmp(png_jmpbuf(png_ptr))){
error:
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
@@ -213,7 +213,7 @@ error:
png_set_progressive_read_fn(png_ptr, NULL,
png_info_callback, png_row_callback,
png_end_callback);
- if (setjmp(png_ptr->jmpbuf)) goto error;
+ if (setjmp(png_jmpbuf(png_ptr))) goto error;
decoder=mem_alloc(sizeof(*decoder));
decoder->png_ptr=png_ptr;
decoder->info_ptr=info_ptr;
@@ -232,7 +232,7 @@ void png_restart(struct cached_image *cimg, unsigned c
png_ptr=((struct png_decoder *)(cimg->decoder))->png_ptr;
info_ptr=((struct png_decoder *)(cimg->decoder))->info_ptr;
end_callback_hit=0;
- if (setjmp(png_ptr->jmpbuf)){
+ if (setjmp(png_jmpbuf(png_ptr))){
img_end(cimg);
return;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-libAfterImage_export_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- libAfterImage/export.c.orig Tue Jul 5 21:59:34 2011
+++ libAfterImage/export.c Tue Jul 5 22:00:02 2011
@@ -483,7 +483,7 @@ ASImage2png_int ( ASImage *im, void *data, png_rw_ptr
png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL );
if ( png_ptr != NULL )
if( (info_ptr = png_create_info_struct(png_ptr)) != NULL )
- if( setjmp(png_ptr->jmpbuf) )
+ if( setjmp(png_jmpbuf(png_ptr)) )
{
png_destroy_info_struct(png_ptr, (png_infopp) &info_ptr);
info_ptr = NULL ;

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-libAfterImage_import_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- libAfterImage/import.c.orig Tue Jul 5 22:13:26 2011
+++ libAfterImage/import.c Tue Jul 5 22:14:14 2011
@@ -1251,7 +1251,7 @@ png2ASImage_int( void *data, png_rw_ptr read_fn, ASIma
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if ( !setjmp (png_ptr->jmpbuf))
+ if ( !setjmp (png_jmpbuf(png_ptr)))
{
ASFlagType rgb_flags = ASStorage_RLEDiffCompress|ASStorage_32Bit ;
@@ -1468,7 +1468,7 @@ typedef struct ASImPNGReadBuffer
static void asim_png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
- ASImPNGReadBuffer *buf = (ASImPNGReadBuffer *)png_ptr->io_ptr;
+ ASImPNGReadBuffer *buf = (ASImPNGReadBuffer *)png_get_io_ptr(png_ptr);
memcpy(data, buf->buffer, length);
buf->buffer += length;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_absimg_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/absimg.c.orig Wed Jul 6 14:57:39 2011
+++ src/absimg.c Wed Jul 6 14:58:00 2011
@@ -96,7 +96,7 @@ char *name;
pngi = png_create_info_struct(pngw);
- if (setjmp(pngw->jmpbuf))
+ if (setjmp(png_jmpbuf(pngw)))
{
png_destroy_write_struct(&pngw, &pngi);
fclose(f);

View File

@ -1,6 +1,9 @@
$OpenBSD: patch-images_fl_png_cxx,v 1.1.1.1 2008/10/19 07:34:45 ajacoutot Exp $
--- images/fl_png.cxx.orig Fri Oct 17 06:15:52 2008
+++ images/fl_png.cxx Fri Oct 17 06:16:18 2008
$OpenBSD: patch-images_fl_png_cxx,v 1.2 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- images/fl_png.cxx.orig Mon Apr 16 08:48:06 2007
+++ images/fl_png.cxx Tue Jul 5 22:22:44 2011
@@ -31,7 +31,7 @@
#if HAVE_LIBPNG
extern "C"
@ -10,3 +13,12 @@ $OpenBSD: patch-images_fl_png_cxx,v 1.1.1.1 2008/10/19 07:34:45 ajacoutot Exp $
# include "libpng/png.h"
#else
# include <png.h>
@@ -62,7 +62,7 @@ bool pngImage::test(const uchar* datas, unsigned size)
#if !HAVE_LIBPNG
return 0;
#else
- return png_check_sig((png_byte*)datas, (int)size)!=0;
+ return png_sig_cmp((png_byte*)datas, 0, (size_t)size)==0;
#endif
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-programs_gaia_Texture_cc,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- programs/gaia/Texture.cc.orig Wed Jul 6 15:30:39 2011
+++ programs/gaia/Texture.cc Wed Jul 6 15:30:50 2011
@@ -308,7 +308,7 @@ void Texture::LoadPNG(int source, ...) {
switch (color_type) {
case PNG_COLOR_TYPE_GRAY:
if (bit_depth < 8)
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
m_glInternalFormat = GL_LUMINANCE8;
m_glFormat = GL_LUMINANCE;
break;

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-source_Irrlicht_CImageLoaderPNG_cpp,v 1.1 2011/07/08 20:38:02 naddy Exp $
Fix build with png-1.5.
--- source/Irrlicht/CImageLoaderPNG.cpp.orig Mon Jul 4 18:44:06 2011
+++ source/Irrlicht/CImageLoaderPNG.cpp Mon Jul 4 18:49:49 2011
@@ -28,7 +28,7 @@ namespace video
static void png_cpexcept_error(png_structp png_ptr, png_const_charp msg)
{
os::Printer::log("PNG FATAL ERROR", msg, ELL_ERROR);
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
// PNG function for file reading
@@ -37,7 +37,7 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, pn
png_size_t check;
// changed by zola {
- io::IReadFile* file=(io::IReadFile*)png_ptr->io_ptr;
+ io::IReadFile* file=(io::IReadFile*)png_get_io_ptr(png_ptr);
check=(png_size_t) file->read((void*)data,(u32)length);
// }
@@ -162,7 +162,7 @@ IImage* CImageLoaderPng::loadImage(io::IReadFile* file
if (BitDepth < 8)
{
if (ColorType==PNG_COLOR_TYPE_GRAY || ColorType==PNG_COLOR_TYPE_GRAY_ALPHA)
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
else
png_set_packing(png_ptr);
}

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-source_Irrlicht_CImageWriterPNG_cpp,v 1.1 2011/07/08 20:38:02 naddy Exp $
--- source/Irrlicht/CImageWriterPNG.cpp.orig Mon Jul 4 19:06:36 2011
+++ source/Irrlicht/CImageWriterPNG.cpp Mon Jul 4 19:17:48 2011
@@ -35,7 +35,7 @@ IImageWriter* createImageWriterPNG()
static void png_cpexcept_error(png_structp png_ptr, png_const_charp msg)
{
os::Printer::log("PNG FATAL ERROR", msg, ELL_ERROR);
- longjmp(png_ptr->jmpbuf, 1);
+ png_longjmp(png_ptr, 1);
}
// PNG function for file writing
@@ -43,7 +43,7 @@ void PNGAPI user_write_data_fcn(png_structp png_ptr, p
{
png_size_t check;
- io::IWriteFile* file=(io::IWriteFile*)png_ptr->io_ptr;
+ io::IWriteFile* file=(io::IWriteFile*)png_get_io_ptr(png_ptr);
check=(png_size_t) file->write((const void*)data,(u32)length);
if (check != length)

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-filters_krita_png_kis_png_converter_cc,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- filters/krita/png/kis_png_converter.cc.orig Wed Jul 6 18:26:22 2011
+++ filters/krita/png/kis_png_converter.cc Wed Jul 6 18:36:12 2011
@@ -221,7 +221,8 @@ KisImageBuilder_Result KisPNGConverter::decode(const K
bool hasalpha = (color_type == PNG_COLOR_TYPE_RGB_ALPHA || color_type == PNG_COLOR_TYPE_GRAY_ALPHA);
// Read image profile
- png_charp profile_name, profile_data;
+ png_charp profile_name;
+ png_bytep profile_data;
int compression_type;
png_uint_32 proflen;
int number_of_passes = 1;
@@ -627,7 +628,7 @@ KisImageBuilder_Result KisPNGConverter::buildFile(cons
} else { // Profile
char* name = new char[(*it)->type().length()+1];
strcpy(name, (*it)->type().ascii());
- png_set_iCCP(png_ptr, info_ptr, name, PNG_COMPRESSION_TYPE_BASE, (char*)(*it)->annotation().data(), (*it) -> annotation() . size());
+ png_set_iCCP(png_ptr, info_ptr, name, PNG_COMPRESSION_TYPE_BASE, (png_byte*)(*it)->annotation().data(), (*it) -> annotation() . size());
}
++it;
}
@@ -785,7 +786,7 @@ void KisPNGConverter::cancel()
void KisPNGConverter::progress(png_structp png_ptr, png_uint_32 row_number, int pass)
{
- if(png_ptr == NULL || row_number > PNG_MAX_UINT || pass > 7) return;
+ if(png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7) return;
// setProgress(row_number);
}

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-filters_krita_png_kis_png_converter_h,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- filters/krita/png/kis_png_converter.h.orig Wed Jul 6 18:31:32 2011
+++ filters/krita/png/kis_png_converter.h Wed Jul 6 18:31:44 2011
@@ -21,6 +21,7 @@
#define _KIS_PNG_CONVERTER_H_
#include <png.h>
+#include <zlib.h>
#include <qvaluevector.h>

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-libmb_mbpixbuf_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- libmb/mbpixbuf.c.orig Tue Jul 5 23:25:58 2011
+++ libmb/mbpixbuf.c Tue Jul 5 23:27:08 2011
@@ -247,7 +247,7 @@ _load_png_file( const char *file,
return NULL;
}
- if ( setjmp( png_ptr->jmpbuf ) ) {
+ if ( setjmp( png_jmpbuf( png_ptr ) ) ) {
png_destroy_read_struct( &png_ptr, &info_ptr, NULL);
fclose(fd);
return NULL;
@@ -269,8 +269,8 @@ _load_png_file( const char *file,
( color_type == PNG_COLOR_TYPE_GRAY_ALPHA ))
png_set_gray_to_rgb(png_ptr);
- if ( info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA
- || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA
+ if ( png_get_color_type ( png_ptr, info_ptr ) == PNG_COLOR_TYPE_RGB_ALPHA
+ || png_get_color_type ( png_ptr, info_ptr ) == PNG_COLOR_TYPE_GRAY_ALPHA
)
*has_alpha = 1;
else

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.20 2011/07/07 15:19:17 naddy Exp $
# $OpenBSD: Makefile,v 1.21 2011/07/08 20:38:00 naddy Exp $
COMMENT= multi-tabbed terminal emulator
@ -26,7 +26,8 @@ LIB_DEPENDS= graphics/jpeg \
WANTLIB= ICE SM X11 Xrender Xpm c fontconfig freetype util m z \
Xft Xau Xdmcp expat pthread-stubs xcb jpeg png
CONFIGURE_STYLE=gnu
AUTOCONF_VERSION=2.61
CONFIGURE_STYLE=autoconf
CONFIGURE_ARGS+=--enable-menubar \
--with-x \
--enable-ttygid=utmp \

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-configure_ac,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- configure.ac.orig Thu Jul 7 09:20:30 2011
+++ configure.ac Thu Jul 7 09:20:51 2011
@@ -952,7 +952,7 @@ AM_CONDITIONAL(USE_JPEG, test "x$support_jpeg" = "xyes
if test "x$support_png" = "xyes"; then
AC_CHECK_LIB(
png,
- png_check_sig,
+ png_sig_cmp,
[],
[support_png=no],
[-lz -lm]

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_init_c,v 1.5 2010/12/02 07:48:42 matthieu Exp $
--- src/init.c.orig Wed Dec 1 22:43:45 2010
+++ src/init.c Wed Dec 1 22:43:45 2010
@@ -3239,7 +3239,7 @@
$OpenBSD: patch-src_init_c,v 1.6 2011/07/08 20:38:00 naddy Exp $
--- src/init.c.orig Fri Jun 13 13:08:13 2008
+++ src/init.c Thu Jul 7 09:13:48 2011
@@ -3239,7 +3239,7 @@ rxvt_create_show_windows( rxvt_t *r, int argc, const c
XGCValues gcvalue;
unsigned long gcmask;
#ifndef NO_FRILLS

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_mpng_c,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/mpng.c.orig Sun Feb 17 15:04:50 2008
+++ src/mpng.c Thu Jul 7 09:25:44 2011
@@ -83,7 +83,7 @@ png_uint_32 png_row_bytes;
display_depth = XDefaultDepth(display,XDefaultScreen(display));
fread(sig, 1, 8, ifile);
- if (!png_check_sig(sig, 8)){
+ if (png_sig_cmp(sig, 0, 8)){
fclose(ifile);
return -1;
}
@@ -113,7 +113,7 @@ png_uint_32 png_row_bytes;
if (png_depth < 8){
if (png_color_type == PNG_COLOR_TYPE_GRAY ){
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
png_row_bytes = png_width;
}else{
png_set_expand(png_ptr);

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-Pgn_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- Pgn.cpp.orig Tue Jul 5 21:23:09 2011
+++ Pgn.cpp Tue Jul 5 21:24:06 2011
@@ -414,7 +414,7 @@ int DecompressPng16(unsigned char *compressedData, int
png_read_info(pngPtr, infoPtr);
- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE)
+ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE)
{
png_set_expand(pngPtr);
}
@@ -565,7 +565,7 @@ int DecompressPng24(unsigned char *compressedData, int
png_read_info( pngPtr, infoPtr ) ;
- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE)
+ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE)
{
png_set_expand(pngPtr);
}
@@ -709,7 +709,7 @@ int DecompressPng32(unsigned char *compressedData, int
png_read_info(pngPtr, infoPtr) ;
- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE)
+ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE)
{
png_set_expand(pngPtr);
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- png.c.orig Wed Jul 6 17:24:44 2011
+++ png.c Wed Jul 6 17:25:02 2011
@@ -57,7 +57,7 @@ read_png(const char *filename, int *width, int *height
return(0);
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
fclose(infile);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-modules_codec_png_c,v 1.1 2011/07/08 20:38:02 naddy Exp $
Fix build with png-1.5.
--- modules/codec/png.c.orig Tue Jul 5 12:28:47 2011
+++ modules/codec/png.c Tue Jul 5 12:29:21 2011
@@ -155,7 +155,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block
p_info = png_create_info_struct( p_png );
if( p_info == NULL )
{
- png_destroy_read_struct( &p_png, png_infopp_NULL, png_infopp_NULL );
+ png_destroy_read_struct( &p_png, NULL, NULL );
block_Release( p_block ); *pp_block = NULL;
return NULL;
}
@@ -163,7 +163,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block
p_end_info = png_create_info_struct( p_png );
if( p_end_info == NULL )
{
- png_destroy_read_struct( &p_png, &p_info, png_infopp_NULL );
+ png_destroy_read_struct( &p_png, &p_info, NULL );
block_Release( p_block ); *pp_block = NULL;
return NULL;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-wrlib_png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- wrlib/png.c.orig Tue Jul 5 22:30:42 2011
+++ wrlib/png.c Tue Jul 5 22:31:03 2011
@@ -97,7 +97,7 @@ RLoadPNG(RContext *context, char *file, int index)
}
RErrorCode = RERR_INTERNAL;
- if (setjmp(png->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png))) {
fclose(f);
png_destroy_read_struct(&png, &pinfo, &einfo);
if (image)

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-xcursorgen_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- xcursorgen.c.orig Wed Jul 6 17:13:20 2011
+++ xcursorgen.c Wed Jul 6 17:13:50 2011
@@ -196,7 +196,7 @@ load_image (struct flist *list, char *prefix)
return NULL;
}
- if (setjmp (png->jmpbuf))
+ if (setjmp (png_jmpbuf (png)))
{
png_destroy_read_struct (&png, &info, NULL);
return NULL;

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- png.c.orig Wed Jul 6 17:16:01 2011
+++ png.c Wed Jul 6 17:17:57 2011
@@ -75,7 +75,7 @@ static void output_error(png_structp png_ptr, png_cons
{
debug(" #error ");
output_warn( png_ptr, str);
- longjmp(png_ptr->jmpbuf, 1); /* return control to outer routine */
+ png_longjmp(png_ptr, 1); /* return control to outer routine */
}
@@ -164,7 +164,7 @@ static int pngHeader(png_structpp png_pp,
png_destroy_read_struct(png_pp, info_pp, end_pp);
return 0;
}
- if (setjmp((*png_pp)->jmpbuf)) {
+ if (setjmp(png_jmpbuf(*png_pp))) {
/* On error */
png_destroy_read_struct(png_pp, info_pp, end_pp);
return 0;
@@ -220,7 +220,7 @@ int pngIdent(char *fullname, char *name)
zclose(zinput_file);
return 0;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* On error */
freeImage(image);
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
@@ -308,7 +308,7 @@ Image *pngLoad(char *fullname, char *name, unsigned in
case PNG_COLOR_TYPE_GRAY_ALPHA:
case PNG_COLOR_TYPE_GRAY:
if (bit_depth < 8)
- png_set_gray_1_2_4_to_8(png_ptr); /* 1 pixlel 1 byte */
+ png_set_expand_gray_1_2_4_to_8(png_ptr); /* 1 pixlel 1 byte */
image = newRGBImage(width, height, 8);
image->rgb.used = 256;
for (i = 0; i < 256; i++) {

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_libimage_png_c,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/libimage/png.c.orig Wed Jul 6 10:53:27 2011
+++ src/libimage/png.c Wed Jul 6 10:53:47 2011
@@ -57,7 +57,7 @@ read_png(const char *filename, int *width, int *height
return(0);
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
fclose(infile);