Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Dec 2014 12:30:50 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r375540 - in head/graphics/simpleviewer: . files
Message-ID:  <201412251230.sBPCUobN082013@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Thu Dec 25 12:30:49 2014
New Revision: 375540
URL: https://svnweb.freebsd.org/changeset/ports/375540
QAT: https://qat.redports.org/buildarchive/r375540/

Log:
  Properly support png 1.5

Added:
  head/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp   (contents, props changed)
Deleted:
  head/graphics/simpleviewer/files/patch-formatpng.cpp
Modified:
  head/graphics/simpleviewer/Makefile
  head/graphics/simpleviewer/files/patch-src_fileslist.cpp

Modified: head/graphics/simpleviewer/Makefile
==============================================================================
--- head/graphics/simpleviewer/Makefile	Thu Dec 25 12:18:54 2014	(r375539)
+++ head/graphics/simpleviewer/Makefile	Thu Dec 25 12:30:49 2014	(r375540)
@@ -14,14 +14,13 @@ COMMENT=	Small and simple OpenGL image v
 LICENSE=	GPLv2
 
 LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
-		libpng15.so:${PORTSDIR}/graphics/png \
+		libpng.so:${PORTSDIR}/graphics/png \
 		libgif.so:${PORTSDIR}/graphics/giflib
 
 USES=		tar:bzip2
 USE_EFL=	imlib2
 USE_GL=		glut
 WRKSRC=		${WRKDIR}/sviewgl-src
-CFLAGS+=	-I${LOCALBASE}/include/libpng15
 MAKE_ARGS=	CC="${CXX}"
 
 PLIST_FILES=	bin/sviewgl

Modified: head/graphics/simpleviewer/files/patch-src_fileslist.cpp
==============================================================================
--- head/graphics/simpleviewer/files/patch-src_fileslist.cpp	Thu Dec 25 12:18:54 2014	(r375539)
+++ head/graphics/simpleviewer/files/patch-src_fileslist.cpp	Thu Dec 25 12:30:49 2014	(r375540)
@@ -1,4 +1,4 @@
---- src/fileslist.cpp.orig	2010-05-13 07:15:11.000000000 +0000
+--- src/fileslist.cpp.orig	2010-05-13 07:15:11 UTC
 +++ src/fileslist.cpp
 @@ -8,6 +8,7 @@
  #include "fileslist.h"

Added: head/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp	Thu Dec 25 12:30:49 2014	(r375540)
@@ -0,0 +1,68 @@
+--- src/formats/formatpng.cpp.orig	2010-08-29 14:33:33 UTC
++++ src/formats/formatpng.cpp
+@@ -57,9 +57,9 @@ bool CFormatPng::Load(const char* filena
+ 	png_read_info(png, info);
+ 
+ 	// get real bits per pixel
+-	m_bppImage	= info->pixel_depth;
++	m_bppImage	= png_get_bit_depth(png, info) * png_get_channels(png, info);
+ 
+-	if(info->color_type == PNG_COLOR_TYPE_PALETTE) {
++	if(png_get_color_type(png, info) == PNG_COLOR_TYPE_PALETTE) {
+ 		png_set_palette_to_rgb(png);
+ 	}
+ 
+@@ -73,20 +73,20 @@ bool CFormatPng::Load(const char* filena
+     if(png_get_valid(png, info, PNG_INFO_tRNS)) {
+         png_set_tRNS_to_alpha(png);
+     }
+-	if(info->bit_depth == 16) {
++	if(png_get_bit_depth(png, info) == 16) {
+ 		png_set_strip_16(png);
+ 	}
+-	if(info->color_type == PNG_COLOR_TYPE_GRAY || info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
++	if(png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY || png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY_ALPHA) {
+ 		png_set_gray_to_rgb(png);
+ 	}
+ 
+ //	int number_of_passes	= png_set_interlace_handling(png);
+ 	png_read_update_info(png, info);
+ 
+-	m_width		= info->width;
+-	m_height	= info->height;
+-	m_pitch		= info->rowbytes;
+-	m_bpp		= info->pixel_depth;
++	m_width		= png_get_image_width(png, info);
++	m_height	= png_get_image_height(png, info);
++	m_pitch		= png_get_rowbytes(png, info);
++	m_bpp		= png_get_bit_depth(png, info) * png_get_channels(png, info);
+ 
+ 	// read file
+ 	if(setjmp(png_jmpbuf(png)) != 0) {
+@@ -98,7 +98,7 @@ bool CFormatPng::Load(const char* filena
+ 	// create buffer and read data
+ 	png_bytep* row_pointers	= new png_bytep[m_height];
+ 	for(int y = 0; y < m_height; y++) {
+-		row_pointers[y]	= new png_byte[info->rowbytes];
++		row_pointers[y]	= new png_byte[png_get_rowbytes(png, info)];
+ 	}
+ 	png_read_image(png, row_pointers);
+ 
+@@ -106,7 +106,7 @@ bool CFormatPng::Load(const char* filena
+ 	m_sizeMem	= m_pitch * m_height;
+ 	m_bitmap	= new unsigned char[m_sizeMem];
+ 
+-	if(info->color_type == PNG_COLOR_TYPE_RGB) {
++	if(png_get_color_type(png, info) == PNG_COLOR_TYPE_RGB) {
+ 		m_format	= GL_RGB;
+ 		for(int y = 0; y < m_height; y++) {
+ 			int dst	= y * m_pitch;
+@@ -123,7 +123,7 @@ bool CFormatPng::Load(const char* filena
+ 			delete[] row_pointers[y];
+ 		}
+ 	}
+-	else if(info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
++	else if(png_get_color_type(png, info) == PNG_COLOR_TYPE_RGB_ALPHA) {
+ 		m_format	= GL_RGBA;
+ 		for(int y = 0; y < m_height; y++) {
+ 			int dst	= y * m_pitch;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412251230.sBPCUobN082013>