summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhoto.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-05-18 18:44:45 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-05-18 18:44:45 (GMT)
commit54196211723b6c139157a3ab50b176f8f1dcd094 (patch)
treeaecb89515c39653204603baad23528da803cc4cd /generic/tkImgPhoto.c
parentc4379d2c51d34a6cba21e73692660730930e73f7 (diff)
downloadtk-54196211723b6c139157a3ab50b176f8f1dcd094.zip
tk-54196211723b6c139157a3ab50b176f8f1dcd094.tar.gz
tk-54196211723b6c139157a3ab50b176f8f1dcd094.tar.bz2
Repair last commit.
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r--generic/tkImgPhoto.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 6e34fe4..0c783f1 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -3858,7 +3858,6 @@ ImgStringWrite(
{
int greenOffset, blueOffset;
Tcl_Obj *data;
- Tcl_Obj *line = Tcl_NewObj();
greenOffset = blockPtr->offset[1] - blockPtr->offset[0];
blueOffset = blockPtr->offset[2] - blockPtr->offset[0];
@@ -3868,20 +3867,19 @@ ImgStringWrite(
int row, col;
for (row=0; row<blockPtr->height; row++) {
+ Tcl_Obj *line = Tcl_NewListObj(blockPtr->width, NULL);
unsigned char *pixelPtr = blockPtr->pixelPtr + blockPtr->offset[0]
+ row * blockPtr->pitch;
for (col=0; col<blockPtr->width; col++) {
- Tcl_AppendPrintfToObj(line, "%s#%02x%02x%02x",
- col ? " " : "", *pixelPtr,
- pixelPtr[greenOffset], pixelPtr[blueOffset]);
+ Tcl_ListObjAppendElement(NULL, line, Tcl_ObjPrintf(
+ "%s#%02x%02x%02x", col ? " " : "", *pixelPtr,
+ pixelPtr[greenOffset], pixelPtr[blueOffset]));
pixelPtr += blockPtr->pixelSize;
}
Tcl_ListObjAppendElement(NULL, data, line);
- Tcl_SetObjLength(line, 0);
}
}
- Tcl_DecrRefCount(line);
Tcl_SetObjResult(interp, data);
return TCL_OK;
}