-
Notifications
You must be signed in to change notification settings - Fork 2
added Endianness access from IFD to python #106
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
base: main
Are you sure you want to change the base?
Changes from all commits
5487c3a
caa423c
9b17ba4
4d0eabd
a34b398
ae9e557
0ca7e74
d63e299
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
class ThreadPool: | ||
"""A Rust-managed thread pool.""" | ||
|
||
def __init__(self, num_threads: int) -> None: | ||
"""Construct a new ThreadPool with the given number of threads.""" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,23 @@ from ._thread_pool import ThreadPool | |
|
||
class Tile: | ||
"""A representation of a TIFF image tile.""" | ||
|
||
@property | ||
def x(self) -> int: | ||
"""The column index this tile represents.""" | ||
|
||
@property | ||
def y(self) -> int: | ||
"""The row index this tile represents.""" | ||
|
||
@property | ||
def compressed_bytes(self) -> Buffer: | ||
"""The compressed bytes underlying this tile.""" | ||
|
||
@property | ||
def compression_method(self) -> CompressionMethod | int: | ||
"""The compression method used by this tile.""" | ||
|
||
Comment on lines
+9
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. black added these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For all intents and purposes black and ruff format are the same, but they have some slight differences. Black is the older tool and ruff format is the preferred newer tool. Sorry for the confusion but we want to be using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In any case, I'd prefer for ruff format to be added as a separate PR with CI validation first, just like the cargo import ordering |
||
async def decode_async( | ||
self, | ||
*, | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -4,8 +4,8 @@ use async_tiff::ImageFileDirectory; | |||
use pyo3::prelude::*; | ||||
|
||||
use crate::enums::{ | ||||
PyCompressionMethod, PyPhotometricInterpretation, PyPlanarConfiguration, PyPredictor, | ||||
PyResolutionUnit, PySampleFormat, | ||||
PyCompressionMethod, PyEndianness, PyPhotometricInterpretation, PyPlanarConfiguration, | ||||
PyPredictor, PyResolutionUnit, PySampleFormat, | ||||
}; | ||||
use crate::geo::PyGeoKeyDirectory; | ||||
use crate::value::PyValue; | ||||
|
@@ -15,6 +15,11 @@ pub(crate) struct PyImageFileDirectory(ImageFileDirectory); | |||
|
||||
#[pymethods] | ||||
impl PyImageFileDirectory { | ||||
#[getter] | ||||
pub fn endianness(&self) -> PyEndianness { | ||||
self.0.endianness().into() | ||||
} | ||||
Comment on lines
+18
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also add this to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No I mean you need to describe this here:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did that (lines 15-16, also comment). What I meant is a |
||||
|
||||
#[getter] | ||||
pub fn new_subfile_type(&self) -> Option<u32> { | ||||
self.0.new_subfile_type() | ||||
|
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 did that