summaryrefslogtreecommitdiff
path: root/silx/third_party/TiffIO.py
diff options
context:
space:
mode:
authorAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2018-12-17 12:28:24 +0100
committerAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2018-12-17 12:28:24 +0100
commitcebdc9244c019224846cb8d2668080fe386a6adc (patch)
treeaedec55da0f9dd4fc4d6c7eb0f58489a956e2e8c /silx/third_party/TiffIO.py
parent159ef14fb9e198bb0066ea14e6b980f065de63dd (diff)
New upstream version 0.9.0+dfsg
Diffstat (limited to 'silx/third_party/TiffIO.py')
-rw-r--r--silx/third_party/TiffIO.py12
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: