Skip to content

Commit

Permalink
pixi images are expected to be little-endian
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed May 30, 2024
1 parent a76e265 commit 50b28f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fabio/pixiimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
__contact__ = "[email protected]"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "03/04/2020"
__date__ = "30/05/2024"

import numpy
import os
Expand Down Expand Up @@ -71,7 +71,7 @@ def _readheader(self, infile):
infile.seek(0)
self.header = self.check_header()
byt = infile.read(4)
framesize = numpy.frombuffer(byt, numpy.int32)
framesize = numpy.frombuffer(byt, numpy.dtype("<i4"))
if framesize * 2 == self._FRAME_SIZE - self._MAGIC_SIZE:
self.header['framesize'] = framesize
self.header['width'] = self._IMAGE_WIDTH
Expand Down Expand Up @@ -123,7 +123,7 @@ def _readdata(self, filepointer, img_num):
imgstart = self.header['offset'] + img_num * self._FRAME_SIZE
filepointer.seek(imgstart, 0)
data = numpy.frombuffer(filepointer.read(self._IMAGE_SIZE),
numpy.uint16).copy()
numpy.dtype("<u2")).copy()
data.shape = self.header['height'], self.header['width']
return data

Expand Down

0 comments on commit 50b28f2

Please sign in to comment.