From 4406e62119acb4946657f017b2cbaf78044ce165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=2E=20Armando=20Sol=C3=A9?= Date: Wed, 25 Oct 2023 17:35:51 +0200 Subject: [PATCH] Do not attempt to decode the 2 bytes read. --- PyMca5/PyMcaIO/TiffIO.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PyMca5/PyMcaIO/TiffIO.py b/PyMca5/PyMcaIO/TiffIO.py index 6ddb7634b..ff455f68a 100644 --- a/PyMca5/PyMcaIO/TiffIO.py +++ b/PyMca5/PyMcaIO/TiffIO.py @@ -30,7 +30,7 @@ __contact__ = "sole@esrf.fr" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "16/12/2022" +__date__ = "25/10/2023" import sys import os @@ -143,13 +143,13 @@ def _initInternalVariables(self, fd=None): self.fd = fd # read the order fd.seek(0) - order = fd.read(2).decode() + order = fd.read(2) if len(order): - if order == "II": + if order == b"II": # intel, little endian fileOrder = "little" self._structChar = '<' - elif order == "MM": + elif order == b"MM": # motorola, high endian fileOrder = "big" self._structChar = '>'