Skip to content
Snippets Groups Projects
Commit e029f3c0 authored by Gabriele Girelli's avatar Gabriele Girelli
Browse files

Fixed func def

parent 165b8095
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ import numpy as np # type: ignore ...@@ -3,7 +3,7 @@ import numpy as np # type: ignore
import warnings import warnings
def get_unwanted_bytes_ids(self, image_group_data, image_data_start, height, width): def get_unwanted_bytes_ids(image_group_data, image_data_start, height, width):
# Check if the byte array size conforms to the image axes size. If not, check # Check if the byte array size conforms to the image axes size. If not, check
# that the number of unexpected (unwanted) bytes is a multiple of the number of # that the number of unexpected (unwanted) bytes is a multiple of the number of
# rows (height), as the same unmber of unwanted bytes is expected to be # rows (height), as the same unmber of unwanted bytes is expected to be
...@@ -13,6 +13,7 @@ def get_unwanted_bytes_ids(self, image_group_data, image_data_start, height, wid ...@@ -13,6 +13,7 @@ def get_unwanted_bytes_ids(self, image_group_data, image_data_start, height, wid
n_unwanted_bytes = (len(image_group_data[image_data_start:])) % (height * width) n_unwanted_bytes = (len(image_group_data[image_data_start:])) % (height * width)
if not n_unwanted_bytes: if not n_unwanted_bytes:
return np.arange(0) return np.arange(0)
print(n_unwanted_bytes)
assert 0 == n_unwanted_bytes % height, ( assert 0 == n_unwanted_bytes % height, (
"An unexpected number of extra bytes was encountered based on the expected" "An unexpected number of extra bytes was encountered based on the expected"
+ " frame size, therefore the file could not be parsed." + " frame size, therefore the file could not be parsed."
...@@ -24,7 +25,7 @@ def get_unwanted_bytes_ids(self, image_group_data, image_data_start, height, wid ...@@ -24,7 +25,7 @@ def get_unwanted_bytes_ids(self, image_group_data, image_data_start, height, wid
) )
def remove_bytes_by_id(self, byte_ids, image_group_data, height): def remove_bytes_by_id(byte_ids, image_group_data, height):
# Remove bytes by ID. # Remove bytes by ID.
bytes_per_row = len(byte_ids) // height bytes_per_row = len(byte_ids) // height
warnings.warn( warnings.warn(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment