|
|
@ -568,19 +568,6 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
|
|
|
|
|
|
|
|
|
|
|
|
png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn);
|
|
|
|
png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn);
|
|
|
|
|
|
|
|
|
|
|
|
#if PNG_LIBPNG_VER>=10500
|
|
|
|
|
|
|
|
#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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#else /* LIBPNG 1.5 */
|
|
|
|
|
|
|
|
info_ptr->channels =
|
|
|
|
|
|
|
|
(image.depth() == 32)
|
|
|
|
|
|
|
|
? (image.hasAlphaBuffer() ? 4 : 3)
|
|
|
|
|
|
|
|
: 1;
|
|
|
|
|
|
|
|
#endif /* LIBPNG 1.5 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
|
|
|
|
png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
|
|
|
|
image.depth() == 1 ? 1 : 8 /* per channel */,
|
|
|
|
image.depth() == 1 ? 1 : 8 /* per channel */,
|
|
|
|
image.depth() == 32
|
|
|
|
image.depth() == 32
|
|
|
|