diff options
author | ericm <ericm> | 2000-01-26 17:02:27 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-01-26 17:02:27 (GMT) |
commit | 9b58b1c5c191be1379a0d3556a8c4792fc25695c (patch) | |
tree | d97ba651572df85b022d1004715882b1de1c11cc | |
parent | aa3710e2c145ee2478db5c698bc2a6ff47911f9b (diff) | |
download | tk-9b58b1c5c191be1379a0d3556a8c4792fc25695c.zip tk-9b58b1c5c191be1379a0d3556a8c4792fc25695c.tar.gz tk-9b58b1c5c191be1379a0d3556a8c4792fc25695c.tar.bz2 |
* generic/tkImgPhoto.c: Fixed bug with use of binary data for
"-data" option to "image create" command.
-rw-r--r-- | generic/tkImgPhoto.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 3ddf72e..97e61af 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -15,7 +15,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.12 1999/12/15 19:27:27 hobbs Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.13 2000/01/26 17:02:27 ericm Exp $ */ #include "tkInt.h" @@ -1670,7 +1670,9 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags) masterPtr->fileString = NULL; } if (data) { - if (data->length) { + if (data->length + || (data->typePtr == &tclByteArrayType + && data->internalRep.otherValuePtr != NULL)) { Tcl_IncrRefCount(data); } else { data = NULL; @@ -3554,9 +3556,11 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr, ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); char *formatString = NULL; - + int len; + if (formatObj) { - formatString = Tcl_GetString(formatObj); + formatString = Tcl_GetByteArrayFromObj(formatObj, &len); + /*Tcl_GetString(formatObj);*/ } /* |