Skip to content

Commit

Permalink
Preserve endian-ness of the source
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul committed Sep 19, 2024
1 parent 9ae5600 commit 349cdaf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bfio/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,16 @@ def _init_writer(self):
else:
big_tiff = False

if self.frontend._metadata.images[0].pixels.big_endian:
byte_order = ">"
else:
byte_order = "<"

self._writer = tifffile.TiffWriter(
self.frontend._file_path, bigtiff=big_tiff, append=False
self.frontend._file_path,
bigtiff=big_tiff,
byteorder=byte_order,
append=False,
)

self._byteorder = self._writer.tiff.byteorder
Expand Down

0 comments on commit 349cdaf

Please sign in to comment.