-
Notifications
You must be signed in to change notification settings - Fork 55
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
base: master
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this 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') |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
Fixes issue #108 . |
No description provided.