diff options
Diffstat (limited to 'silx/third_party/TiffIO.py')
-rw-r--r-- | silx/third_party/TiffIO.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/silx/third_party/TiffIO.py b/silx/third_party/TiffIO.py index 156ae11..8768cff 100644 --- a/silx/third_party/TiffIO.py +++ b/silx/third_party/TiffIO.py @@ -653,9 +653,9 @@ class TiffIO(object): fd.seek(stripOffsets[0] + rowMin * bytesPerRow) nBytes = (rowMax-rowMin+1) * bytesPerRow if self._swap: - readout = numpy.fromstring(fd.read(nBytes), dtype).byteswap() + readout = numpy.copy(numpy.frombuffer(fd.read(nBytes), dtype)).byteswap() else: - readout = numpy.fromstring(fd.read(nBytes), dtype) + readout = numpy.copy(numpy.frombuffer(fd.read(nBytes), dtype)) if hasattr(nBits, 'index'): readout.shape = -1, nColumns, len(nBits) elif info['colormap'] is not None: @@ -704,9 +704,9 @@ class TiffIO(object): #if read -128 ignore the byte continue if self._swap: - readout = numpy.fromstring(bufferBytes, dtype).byteswap() + readout = numpy.copy(numpy.frombuffer(bufferBytes, dtype)).byteswap() else: - readout = numpy.fromstring(bufferBytes, dtype) + readout = numpy.copy(numpy.frombuffer(bufferBytes, dtype)) if hasattr(nBits, 'index'): readout.shape = -1, nColumns, len(nBits) elif info['colormap'] is not None: @@ -719,9 +719,9 @@ class TiffIO(object): if 1: #use numpy if self._swap: - readout = numpy.fromstring(fd.read(nBytes), dtype).byteswap() + readout = numpy.copy(numpy.frombuffer(fd.read(nBytes), dtype)).byteswap() else: - readout = numpy.fromstring(fd.read(nBytes), dtype) + readout = numpy.copy(numpy.frombuffer(fd.read(nBytes), dtype)) if hasattr(nBits, 'index'): readout.shape = -1, nColumns, len(nBits) elif colormap is not None: |