Skip to content

Commit

Permalink
Fix some of the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSegerblomRex committed Jun 28, 2024
1 parent affafa1 commit 6f0d2a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libtiff/test_bittools.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_setgetbit():


def test_setgetword():
for dtype in [numpy.ubyte, numpy.int32, numpy.float64]:
for dtype in [numpy.int32, numpy.float64]:
arr = numpy.array(list(range(-256, 256)), dtype=dtype)
arr2 = numpy.zeros(arr.shape, dtype=arr.dtype)
for i in range(arr.nbytes):
Expand Down
1 change: 1 addition & 0 deletions libtiff/tiff_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ def tif_write(_tif, _offset, _data):

compression = 1 / (float(compressed_data_size) / image_data_size)

total_size = int(total_size)
if compressed_data_size != image_data_size:
sdiff = image_data_size - compressed_data_size
total_size -= sdiff
Expand Down
1 change: 1 addition & 0 deletions libtiff/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def isindisk(path):

def bytes2str(bytes):
lst = []
bytes = int(bytes)
Pbytes = bytes // 1024**5
if Pbytes:
lst.append('%sPi' % (Pbytes))
Expand Down

0 comments on commit 6f0d2a0

Please sign in to comment.