summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-24 21:44:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-24 21:44:23 (GMT)
commit8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b (patch)
treeb7312980140ad09d7774594809805bb8b7f9bda4 /generic
parentaab5e7248e2ac4015d9a771cd81e76de40083932 (diff)
downloadtk-8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b.zip
tk-8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b.tar.gz
tk-8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b.tar.bz2
Don't use -encoding "binary" any more in Tk
Diffstat (limited to 'generic')
-rw-r--r--generic/tkImgBmap.c4
-rw-r--r--generic/tkImgGIF.c4
-rw-r--r--generic/tkImgPNG.c9
-rw-r--r--generic/tkImgPPM.c5
-rw-r--r--generic/tkImgPhoto.c13
5 files changed, 6 insertions, 29 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,