summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPPM.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-03-06 15:05:20 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-03-06 15:05:20 (GMT)
commitb180774f6bce433082da35c309b89e6bfa766152 (patch)
treecf2cecb4facabb94108e75d9490c5b0fb25dd347 /generic/tkImgPPM.c
parent717fec397c31305a08d57a4ca6aa8bc9e038c5a6 (diff)
downloadtk-b180774f6bce433082da35c309b89e6bfa766152.zip
tk-b180774f6bce433082da35c309b89e6bfa766152.tar.gz
tk-b180774f6bce433082da35c309b89e6bfa766152.tar.bz2
TIP#116 implementation. Docs still to come, tests will never be done because
they could never be done portably as they'd inevitably depend on the total amount of memory available to the process... :^(
Diffstat (limited to 'generic/tkImgPPM.c')
-rw-r--r--generic/tkImgPPM.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c
index 9715cf4..2abe1fd 100644
--- a/generic/tkImgPPM.c
+++ b/generic/tkImgPPM.c
@@ -13,7 +13,7 @@
* Department of Computer Science,
* Australian National University.
*
- * RCS: @(#) $Id: tkImgPPM.c,v 1.10 2002/06/14 13:35:48 dkf Exp $
+ * RCS: @(#) $Id: tkImgPPM.c,v 1.11 2003/03/06 15:05:35 dkf Exp $
*/
#define USE_OLD_IMAGE
@@ -189,7 +189,10 @@ FileReadPPM(interp, chan, fileName, formatString, imageHandle, destX, destY,
block.width = width;
block.pitch = block.pixelSize * fileWidth;
- Tk_PhotoExpand(imageHandle, destX + width, destY + height);
+ if (Tk_PhotoExpand(interp, imageHandle,
+ destX + width, destY + height) != TCL_OK) {
+ return TCL_ERROR;
+ }
if (srcY > 0) {
Tcl_Seek(chan, (Tcl_WideInt)(srcY * block.pitch), SEEK_CUR);
@@ -228,8 +231,11 @@ FileReadPPM(interp, chan, fileName, formatString, imageHandle, destX, destY,
}
}
block.height = nLines;
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, nLines,
- TK_PHOTO_COMPOSITE_SET);
+ if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
+ width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
+ ckfree((char *) pixelPtr);
+ return TCL_ERROR;
+ }
destY += nLines;
}