diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-24 21:44:54 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-24 21:44:54 (GMT) |
commit | 30226e3d9d3e67e0f4544d6bf395a516b3fb3e9d (patch) | |
tree | f3d21b1961d0fd7ffcfa28a171336dc87c4e87e3 /generic | |
parent | 75ae724f614a8e7f5a3b7efd18c398be6b3adbaf (diff) | |
parent | 8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b (diff) | |
download | tk-30226e3d9d3e67e0f4544d6bf395a516b3fb3e9d.zip tk-30226e3d9d3e67e0f4544d6bf395a516b3fb3e9d.tar.gz tk-30226e3d9d3e67e0f4544d6bf395a516b3fb3e9d.tar.bz2 |
Don't use -encoding "binary" any more in Tk
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkImgBmap.c | 4 | ||||
-rw-r--r-- | generic/tkImgGIF.c | 4 | ||||
-rw-r--r-- | generic/tkImgPNG.c | 9 | ||||
-rw-r--r-- | generic/tkImgPPM.c | 5 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 13 |
5 files changed, 6 insertions, 29 deletions
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 2fad264..116ef41 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -513,10 +513,6 @@ TkGetBitmapData( != TCL_OK) { return NULL; } - if (Tcl_SetChannelOption(interp, pi.chan, "-encoding", "binary") - != TCL_OK) { - return NULL; - } } else { pi.chan = NULL; } diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index a58f820..32b01e4 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -1928,8 +1928,8 @@ FileWriteGIF( if (!chan) { return TCL_ERROR; } - if (Tcl_SetChannelOption(interp, chan, "-translation", - "binary") != TCL_OK) { + if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") + != TCL_OK) { Tcl_Close(NULL, chan); return TCL_ERROR; } diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 2879ae2..a49ed15 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -3765,13 +3765,8 @@ FileWritePNG( goto cleanup; } - /* - * Set the translation mode to binary so that CR and LF are not to the - * platform's EOL sequence. - */ - - if (Tcl_SetChannelOption(interp, chan, "-translation", - "binary") != TCL_OK) { + if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") + != TCL_OK) { goto cleanup; } diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index 50d37d7..a9d0391 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -305,11 +305,6 @@ FileWritePPM( Tcl_Close(NULL, chan); return TCL_ERROR; } - if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary") - != TCL_OK) { - Tcl_Close(NULL, chan); - return TCL_ERROR; - } snprintf(header, sizeof(header), "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); Tcl_Write(chan, header, TCL_INDEX_NONE); diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 0c38cc4..27ffbed 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -1053,11 +1053,6 @@ ImgPhotoCmd( Tcl_Close(NULL, chan); return TCL_ERROR; } - if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary") - != TCL_OK) { - Tcl_Close(NULL, chan); - return TCL_ERROR; - } if (MatchFileFormat(interp, chan, Tcl_GetString(options.name), options.format, @@ -2092,12 +2087,8 @@ ImgPhotoConfigureModel( metadataOutObj = Tcl_NewDictObj(); Tcl_IncrRefCount(metadataOutObj); - /* - * -translation binary also sets -encoding binary - */ - - if ((Tcl_SetChannelOption(interp, chan, - "-translation", "binary") != TCL_OK) || + if ((Tcl_SetChannelOption(interp, chan, "-translation", "binary") + != TCL_OK) || (MatchFileFormat(interp, chan, modelPtr->fileString, modelPtr->format, modelPtr->metadata, metadataOutObj, &imageFormat, &imageFormatVersion3, |