Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix endianness issue, close bug, py3: bytes/str, imports #110

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nlhepler
Copy link

No description provided.

@nlhepler
Copy link
Author

This addresses a few niggling issues I've had with pylibtiff, esp in the py3 context. Also in here is a bugfix (close could sometimes throw an exception) and to report endianness differences in the numpy array dtype.

Copy link
Owner

@pearu pearu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some nits.
Is this PR ready or work-in-progress?

'bitarray-a1646c0'))
import bitarray as _bitarray # noqa: F402
_sys.modules['libtiff.bitarray'] = _bitarray
_bitarray = _os.path.join(_os.path.dirname(__file__), 'bitarray-a1646c0')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use _bitarray_dir instead of _bitarray.

@@ -519,7 +519,7 @@ def open(cls, filename, mode='r'):
return tiff

@staticmethod
def get_numpy_type(bits, sample_format=None):
def get_numpy_type(bits, sample_format=None, byte_swapped=False):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use self.IsByteSwapped() as a default value to byte_swapped?
If so, then eliminate byte_swapped argument?

@pearu
Copy link
Owner

pearu commented Feb 3, 2020

Fixes issue #108 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants