diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-28 22:13:30 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-28 22:13:30 (GMT) |
commit | 474bd9cda9c65a64819dd2992b1eb7cf3de2ca24 (patch) | |
tree | f5bfccd1a6d222f2653a38672d42c9ec0d6ef26a | |
parent | 3a2e04878104594ff8c0163ef829a0492abe13bd (diff) | |
download | tk-474bd9cda9c65a64819dd2992b1eb7cf3de2ca24.zip tk-474bd9cda9c65a64819dd2992b1eb7cf3de2ca24.tar.gz tk-474bd9cda9c65a64819dd2992b1eb7cf3de2ca24.tar.bz2 |
Applied Michael Kirkham's fix to make all PngSuite images work.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | generic/tkImgPNG.c | 5 |
2 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2008-12-28 Donal K. Fellows <dkf@users.sf.net> + * generic/tkImgPNG.c (ReadIDAT): Corrected code to transfer blocks of + compressed data into the Tcl_ZlibStream. Allows the reading of all + images from PngSuite set. Thanks to Michael Kirkham for fix/testing. + TIP #244 IMPLEMENTATION * generic/tkImgPNG.c, tests/imgPNG.test, doc/photo.n: Adaptation of diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index eb5ef7c..73ffa46 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgPNG.c,v 1.1 2008/12/28 13:08:39 dkf Exp $ + * RCS: @(#) $Id: tkImgPNG.c,v 1.2 2008/12/28 22:13:31 dkf Exp $ */ #include "tkInt.h" @@ -2054,14 +2054,13 @@ ReadIDAT( } inputObj = Tcl_NewObj(); - Tcl_SetByteArrayLength(inputObj, PNG_BLOCK_SZ); Tcl_IncrRefCount(inputObj); + inputPtr = Tcl_SetByteArrayLength(inputObj, blockSz); /* * Read the next bit of IDAT chunk data, up to read buffer size. */ - inputPtr = Tcl_GetByteArrayFromObj(inputObj, NULL); if (ReadData(interp, pngPtr, inputPtr, blockSz, &crc) == TCL_ERROR) { Tcl_DecrRefCount(inputObj); |