Skip to content

Commit 50b28f2

Browse files
committed
pixi images are expected to be little-endian
1 parent a76e265 commit 50b28f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fabio/pixiimage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
__contact__ = "[email protected]"
3838
__license__ = "MIT"
3939
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
40-
__date__ = "03/04/2020"
40+
__date__ = "30/05/2024"
4141

4242
import numpy
4343
import os
@@ -71,7 +71,7 @@ def _readheader(self, infile):
7171
infile.seek(0)
7272
self.header = self.check_header()
7373
byt = infile.read(4)
74-
framesize = numpy.frombuffer(byt, numpy.int32)
74+
framesize = numpy.frombuffer(byt, numpy.dtype("<i4"))
7575
if framesize * 2 == self._FRAME_SIZE - self._MAGIC_SIZE:
7676
self.header['framesize'] = framesize
7777
self.header['width'] = self._IMAGE_WIDTH
@@ -123,7 +123,7 @@ def _readdata(self, filepointer, img_num):
123123
imgstart = self.header['offset'] + img_num * self._FRAME_SIZE
124124
filepointer.seek(imgstart, 0)
125125
data = numpy.frombuffer(filepointer.read(self._IMAGE_SIZE),
126-
numpy.uint16).copy()
126+
numpy.dtype("<u2")).copy()
127127
data.shape = self.header['height'], self.header['width']
128128
return data
129129

0 commit comments

Comments
 (0)