head 1.6; access; symbols pkgsrc-2017Q3:1.5.0.56 pkgsrc-2017Q3-base:1.5 pkgsrc-2017Q2:1.5.0.52 pkgsrc-2017Q2-base:1.5 pkgsrc-2017Q1:1.5.0.50 pkgsrc-2017Q1-base:1.5 pkgsrc-2016Q4:1.5.0.48 pkgsrc-2016Q4-base:1.5 pkgsrc-2016Q3:1.5.0.46 pkgsrc-2016Q3-base:1.5 pkgsrc-2016Q2:1.5.0.44 pkgsrc-2016Q2-base:1.5 pkgsrc-2016Q1:1.5.0.42 pkgsrc-2016Q1-base:1.5 pkgsrc-2015Q4:1.5.0.40 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.38 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.36 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.34 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.5.0.32 pkgsrc-2014Q4-base:1.5 pkgsrc-2014Q3:1.5.0.30 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.5.0.28 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.26 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.24 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.22 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.5.0.20 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.5.0.18 pkgsrc-2013Q1-base:1.5 pkgsrc-2012Q4:1.5.0.16 pkgsrc-2012Q4-base:1.5 pkgsrc-2012Q3:1.5.0.14 pkgsrc-2012Q3-base:1.5 pkgsrc-2012Q2:1.5.0.12 pkgsrc-2012Q2-base:1.5 pkgsrc-2012Q1:1.5.0.10 pkgsrc-2012Q1-base:1.5 pkgsrc-2011Q4:1.5.0.8 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q3:1.5.0.6 pkgsrc-2011Q3-base:1.5 pkgsrc-2011Q2:1.5.0.4 pkgsrc-2011Q2-base:1.5 pkgsrc-2011Q1:1.5.0.2 pkgsrc-2011Q1-base:1.5 pkgsrc-2010Q4:1.1.0.6 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.4 pkgsrc-2010Q3-base:1.1 pkgsrc-2010Q2:1.1.0.2 pkgsrc-2010Q2-base:1.1; locks; strict; comment @# @; 1.6 date 2017.09.26.10.27.22; author wiz; state dead; branches; next 1.5; commitid 9ARpkXTuh9Wg2H8A; 1.5 date 2011.03.25.15.28.26; author wiz; state Exp; branches; next 1.4; 1.4 date 2011.03.18.15.36.01; author wiz; state Exp; branches; next 1.3; 1.3 date 2011.03.06.16.11.03; author wiz; state Exp; branches; next 1.2; 1.2 date 2011.01.16.12.36.59; author tnn; state Exp; branches; next 1.1; 1.1 date 2010.06.13.22.45.50; author wiz; state Exp; branches; next ; desc @@ 1.6 log @*: remove qt3 and the packages using it, including KDE3 Announced in https://mail-index.netbsd.org/pkgsrc-users/2017/09/10/msg025556.html @ text @$NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $ --- src/kernel/qpngio.cpp.orig 2007-02-02 10:01:15.000000000 -0400 +++ src/kernel/qpngio.cpp @@@@ -43,6 +43,7 @@@@ #include "qiodevice.h" #include +#include #ifdef Q_OS_TEMP @@@@ -123,9 +124,24 @@@@ void setup_qt( QImage& image, png_struct png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); + png_colorp info_ptr_palette = NULL; + int info_ptr_num_palette = 0; + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) { + png_get_PLTE(png_ptr, info_ptr, &info_ptr_palette, &info_ptr_num_palette); + } + + png_bytep info_ptr_trans_alpha = NULL; + int info_ptr_num_trans = 0; + png_color_16p info_ptr_trans_color = NULL; + + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { + png_get_tRNS(png_ptr, info_ptr, &info_ptr_trans_alpha, &info_ptr_num_trans, &info_ptr_trans_color); + } + + if ( color_type == PNG_COLOR_TYPE_GRAY ) { // Black & White or 8-bit grayscale - if ( bit_depth == 1 && info_ptr->channels == 1 ) { + if ( bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1 ) { png_set_invert_mono( png_ptr ); png_read_update_info( png_ptr, info_ptr ); if (!image.create( width, height, 1, 2, QImage::BigEndian )) @@@@ -159,7 +175,7 @@@@ void setup_qt( QImage& image, png_struct image.setColor( i, qRgba(c,c,c,0xff) ); } if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { - const int g = info_ptr->trans_values.gray; + const int g = info_ptr_trans_color->gray; if (g < ncols) { image.setAlphaBuffer(TRUE); image.setColor(g, image.color(g) & RGB_MASK); @@@@ -168,7 +184,7 @@@@ void setup_qt( QImage& image, png_struct } } else if ( color_type == PNG_COLOR_TYPE_PALETTE && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE) - && info_ptr->num_palette <= 256 ) + && info_ptr_num_palette <= 256 ) { // 1-bit and 8-bit color if ( bit_depth != 1 ) @@@@ -176,28 +192,28 @@@@ void setup_qt( QImage& image, png_struct png_read_update_info( png_ptr, info_ptr ); png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); - if (!image.create(width, height, bit_depth, info_ptr->num_palette, + if (!image.create(width, height, bit_depth, info_ptr_num_palette, QImage::BigEndian)) return; int i = 0; if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { image.setAlphaBuffer( TRUE ); - while ( i < info_ptr->num_trans ) { + while ( i < info_ptr_num_trans ) { image.setColor(i, qRgba( - info_ptr->palette[i].red, - info_ptr->palette[i].green, - info_ptr->palette[i].blue, - info_ptr->trans[i] + info_ptr_palette[i].red, + info_ptr_palette[i].green, + info_ptr_palette[i].blue, + info_ptr_trans_alpha[i] ) ); i++; } } - while ( i < info_ptr->num_palette ) { + while ( i < info_ptr_num_palette ) { image.setColor(i, qRgba( - info_ptr->palette[i].red, - info_ptr->palette[i].green, - info_ptr->palette[i].blue, + info_ptr_palette[i].red, + info_ptr_palette[i].green, + info_ptr_palette[i].blue, 0xff ) ); @@@@ -284,7 +300,7 @@@@ void read_png_image(QImageIO* iio) return; } - if (setjmp(png_ptr->jmpbuf)) { + if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); iio->setStatus(-4); return; @@@@ -469,7 +485,7 @@@@ bool QPNGImageWriter::writeImage(const Q return FALSE; } - if (setjmp(png_ptr->jmpbuf)) { + if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_write_struct(&png_ptr, &info_ptr); return FALSE; } @@@@ -491,10 +507,16 @@@@ bool QPNGImageWriter::writeImage(const Q png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn); +#warning XXXtnn not too sure about this +/* +according to png.h, channels is only used on read, not writes, so we +should be able to comment this out. + info_ptr->channels = (image.depth() == 32) ? (image.hasAlphaBuffer() ? 4 : 3) : 1; +*/ png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(), image.depth() == 1 ? 1 : 8 /* per channel */, @@@@ -504,11 +526,12 @@@@ bool QPNGImageWriter::writeImage(const Q : PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_PALETTE, 0, 0, 0); + png_color_8 sig_bit; + sig_bit.red = 8; + sig_bit.green = 8; + sig_bit.blue = 8; + png_set_sBIT(png_ptr, info_ptr, &sig_bit); - //png_set_sBIT(png_ptr, info_ptr, 8); - info_ptr->sig_bit.red = 8; - info_ptr->sig_bit.green = 8; - info_ptr->sig_bit.blue = 8; if (image.depth() == 1 && image.bitOrder() == QImage::LittleEndian) png_set_packswap(png_ptr); @@@@ -522,11 +545,14 @@@@ bool QPNGImageWriter::writeImage(const Q png_set_PLTE(png_ptr, info_ptr, palette, num_palette); int* trans = new int[num_palette]; int num_trans = 0; + png_colorp info_ptr_palette = NULL; + int tmp; + png_get_PLTE(png_ptr, info_ptr, &info_ptr_palette, &tmp); for (int i=0; ipalette[i].red = qRed(rgb); - info_ptr->palette[i].green = qGreen(rgb); - info_ptr->palette[i].blue = qBlue(rgb); + info_ptr_palette[i].red = qRed(rgb); + info_ptr_palette[i].green = qGreen(rgb); + info_ptr_palette[i].blue = qBlue(rgb); if (image.hasAlphaBuffer()) { trans[i] = rgb >> 24; if (trans[i] < 255) { @@@@ -534,6 +560,7 @@@@ bool QPNGImageWriter::writeImage(const Q } } } + png_set_PLTE(png_ptr, info_ptr, info_ptr_palette, num_palette); if (num_trans) { copy_trans = new png_byte[num_trans]; for (int i=0; isig_bit.alpha = 8; + png_color_8p sig_bit; + png_get_sBIT(png_ptr, info_ptr, &sig_bit); + sig_bit->alpha = 8; + png_set_sBIT(png_ptr, info_ptr, sig_bit); } // Swap ARGB to RGBA (normal PNG format) before saving on @@@@ -1030,7 +1060,7 @@@@ int QPNGFormat::decode(QImage& img, QIma return -1; } - if (setjmp((png_ptr)->jmpbuf)) { + if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, 0); image = 0; return -1; @@@@ -1057,7 +1087,7 @@@@ int QPNGFormat::decode(QImage& img, QIma if ( !png_ptr ) return 0; - if (setjmp(png_ptr->jmpbuf)) { + if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, 0); image = 0; state = MovieStart; @@@@ -1117,7 +1147,7 @@@@ void QPNGFormat::end(png_structp png, pn consumer->frameDone(QPoint(offx,offy),r); consumer->end(); state = FrameStart; - unused_data = (int)png->buffer_size; // Since libpng doesn't tell us + unused_data = png_process_data_pause(png, 0); } #ifdef PNG_USER_CHUNKS_SUPPORTED @ 1.5 log @Fix sbit handling in png patch. From Marko Schütz Schmuck on pkgsrc-users, fixing core dumps in kmymoney and kphotoalbum. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD$ @ 1.4 log @Fix compress/uncompress handling correctly. @ text @d1 1 a1 1 $NetBSD: patch-as,v 1.3 2011/03/06 16:11:03 wiz Exp $ d3 1 a3 1 --- src/kernel/qpngio.cpp.orig 2007-02-02 14:01:15.000000000 +0000 d131 1 a131 1 @@@@ -504,11 +526,13 @@@@ bool QPNGImageWriter::writeImage(const Q d135 5 a139 6 + png_color_8p sig_bit; + png_get_sBIT(png_ptr, info_ptr, &sig_bit); + sig_bit->red = 8; + sig_bit->green = 8; + sig_bit->blue = 8; + png_set_sBIT(png_ptr, info_ptr, sig_bit); d148 1 a148 1 @@@@ -522,11 +546,14 @@@@ bool QPNGImageWriter::writeImage(const Q d166 1 a166 1 @@@@ -534,6 +561,7 @@@@ bool QPNGImageWriter::writeImage(const Q d174 1 a174 1 @@@@ -544,7 +572,10 @@@@ bool QPNGImageWriter::writeImage(const Q d186 1 a186 1 @@@@ -1030,7 +1061,7 @@@@ int QPNGFormat::decode(QImage& img, QIma d195 1 a195 1 @@@@ -1057,7 +1088,7 @@@@ int QPNGFormat::decode(QImage& img, QIma d204 1 a204 1 @@@@ -1117,7 +1148,7 @@@@ void QPNGFormat::end(png_structp png, pn @ 1.3 log @Improve png-1.5 patch. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-as,v 1.2 2011/01/16 12:36:59 tnn Exp $ d5 9 a13 1 @@@@ -123,9 +123,24 @@@@ void setup_qt( QImage& image, png_struct d39 1 a39 1 @@@@ -159,7 +174,7 @@@@ void setup_qt( QImage& image, png_struct d48 1 a48 1 @@@@ -168,7 +183,7 @@@@ void setup_qt( QImage& image, png_struct d57 1 a57 1 @@@@ -176,28 +191,28 @@@@ void setup_qt( QImage& image, png_struct d96 1 a96 1 @@@@ -284,7 +299,7 @@@@ void read_png_image(QImageIO* iio) d105 1 a105 1 @@@@ -469,7 +484,7 @@@@ bool QPNGImageWriter::writeImage(const Q d114 1 a114 1 @@@@ -491,10 +506,16 @@@@ bool QPNGImageWriter::writeImage(const Q d131 1 a131 1 @@@@ -504,11 +525,13 @@@@ bool QPNGImageWriter::writeImage(const Q d149 1 a149 1 @@@@ -522,11 +545,14 @@@@ bool QPNGImageWriter::writeImage(const Q d167 1 a167 1 @@@@ -534,6 +560,7 @@@@ bool QPNGImageWriter::writeImage(const Q d175 1 a175 1 @@@@ -544,7 +571,10 @@@@ bool QPNGImageWriter::writeImage(const Q d187 1 a187 1 @@@@ -1030,7 +1060,7 @@@@ int QPNGFormat::decode(QImage& img, QIma d196 1 a196 1 @@@@ -1057,7 +1087,7 @@@@ int QPNGFormat::decode(QImage& img, QIma d205 1 a205 1 @@@@ -1117,7 +1147,7 @@@@ void QPNGFormat::end(png_structp png, pn a213 12 @@@@ -1232,8 +1262,11 @@@@ void qInitPngIO() void qt_zlib_compression_hack() { +#warning XXXtnn unresolved symbols +/* compress(0,0,0,0); uncompress(0,0,0,0); +*/ } #endif // QT_NO_IMAGEIO_PNG @ 1.2 log @Attempt to fix png-1.5 fallout. Only build tested. @ text @d1 1 a1 1 $NetBSD$ d9 2 a10 2 + png_colorp info_ptr_palette; + int info_ptr_num_palette; d15 3 a17 3 + png_bytep info_ptr_trans_alpha; + int info_ptr_num_trans; + png_color_16p info_ptr_trans_color; d145 1 a145 1 + png_colorp info_ptr_palette; d197 1 a197 1 @@@@ -1117,7 +1147,8 @@@@ void QPNGFormat::end(png_structp png, pn d202 1 a202 2 +#warning XXXtnn don't know how to fix this. + unused_data = 0; /* (int)png->buffer_size; // Since libpng doesn't tell us */ d206 1 a206 1 @@@@ -1232,8 +1263,11 @@@@ void qInitPngIO() @ 1.1 log @Bump PKGREVISION for libpng shlib name change. Also add some patches to remove use of deprecated symbols and fix other problems when looking for or compiling against libpng-1.4.x. @ text @d5 27 a31 1 @@@@ -159,7 +159,7 @@@@ void setup_qt( QImage& image, png_struct d36 1 a36 1 + const int g = info_ptr->trans_color.gray; d40 26 a65 4 @@@@ -187,7 +187,7 @@@@ void setup_qt( QImage& image, png_struct info_ptr->palette[i].red, info_ptr->palette[i].green, info_ptr->palette[i].blue, d67 4 a70 1 + info_ptr->trans_alpha[i] d74 145 @