From 8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 24 Jun 2024 21:44:23 +0000 Subject: Don't use -encoding "binary" any more in Tk --- generic/tkImgBmap.c | 4 ---- generic/tkImgGIF.c | 4 ++-- generic/tkImgPNG.c | 9 ++------- generic/tkImgPPM.c | 5 ----- generic/tkImgPhoto.c | 13 ++----------- win/tkWinWm.c | 5 ----- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index a7da3d9..49de20a 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 28c1b5b..0138e68 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -1111,11 +1111,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, @@ -2166,12 +2161,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, diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f6d3216..7938539 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -1436,11 +1436,6 @@ ReadIconOrCursorFromFile( Tcl_Close(NULL, channel); return NULL; } - if (Tcl_SetChannelOption(interp, channel, "-encoding", "binary") - != TCL_OK) { - Tcl_Close(NULL, channel); - return NULL; - } /* * Allocate memory for the resource structure -- cgit v0.12