Add a Bug note about planar configuration

This commit is contained in:
A. Molzer committed 2025-07-25 21:13:41 +02:00
1 parent f671293bd8
commit d70c31dcbf
1 file changed
+32
+32
View File
@@ -1023,6 +1023,12 @@ impl<R: Read + Seek> Decoder<R> {
/// channels of individual *bit* length and format each. /// channels of individual *bit* length and format each.
/// ///
/// See [`Self::colortype`] to describe the sample types. /// See [`Self::colortype`] to describe the sample types.
///
/// # Bugs
///
/// When the image is stored as a planar configuration, this method will currently only
/// indicate the layout needed to read the first data plane. This will be fixed in a future
/// major version of `tiff`.
pub fn image_chunk_buffer_layout( pub fn image_chunk_buffer_layout(
&mut self, &mut self,
chunk_index: u32, chunk_index: u32,
@@ -1041,6 +1047,11 @@ impl<R: Read + Seek> Decoder<R> {
} }
/// Read the specified chunk (at index `chunk_index`) and return the binary data as a Vector. /// Read the specified chunk (at index `chunk_index`) and return the binary data as a Vector.
///
/// # Bugs
///
/// When the image is stored as a planar configuration, this method will currently only read
/// the first sample's plane. This will be fixed in a future major version of `tiff`.
pub fn read_chunk(&mut self, chunk_index: u32) -> TiffResult<DecodingResult> { pub fn read_chunk(&mut self, chunk_index: u32) -> TiffResult<DecodingResult> {
let data_dims = self.image().chunk_data_dimensions(chunk_index)?; let data_dims = self.image().chunk_data_dimensions(chunk_index)?;
@@ -1056,6 +1067,11 @@ impl<R: Read + Seek> Decoder<R> {
/// Returns a [`TiffError::UsageError`] if the chunk is smaller than the size indicated with a /// Returns a [`TiffError::UsageError`] if the chunk is smaller than the size indicated with a
/// call to [`Self::image_chunk_buffer_layout`]. Note that the alignment may be arbitrary, but /// call to [`Self::image_chunk_buffer_layout`]. Note that the alignment may be arbitrary, but
/// an alignment smaller than the preferred alignment may perform worse. /// an alignment smaller than the preferred alignment may perform worse.
///
/// # Bugs
///
/// When the image is stored as a planar configuration, this method will currently only read
/// the first sample's plane. This will be fixed in a future major version of `tiff`.
pub fn read_chunk_bytes(&mut self, chunk_index: u32, buffer: &mut [u8]) -> TiffResult<()> { pub fn read_chunk_bytes(&mut self, chunk_index: u32, buffer: &mut [u8]) -> TiffResult<()> {
let data_dims = self.image().chunk_data_dimensions(chunk_index)?; let data_dims = self.image().chunk_data_dimensions(chunk_index)?;
@@ -1093,6 +1109,12 @@ impl<R: Read + Seek> Decoder<R> {
/// channels of individual *bit* length and format each. /// channels of individual *bit* length and format each.
/// ///
/// See [`Self::colortype`] to describe the sample types. /// See [`Self::colortype`] to describe the sample types.
///
/// # Bugs
///
/// When the image is stored as a planar configuration, this method will currently only
/// indicate the layout needed to read the first data plane. This will be fixed in a future
/// major version of `tiff`.
pub fn image_buffer_layout(&mut self) -> TiffResult<BufferLayoutPreference> { pub fn image_buffer_layout(&mut self) -> TiffResult<BufferLayoutPreference> {
let data_dims @ (width, height) = (self.image.width, self.image.height); let data_dims @ (width, height) = (self.image.width, self.image.height);
@@ -1109,6 +1131,11 @@ impl<R: Read + Seek> Decoder<R> {
} }
/// Decodes the entire image and return it as a Vector /// Decodes the entire image and return it as a Vector
///
/// # Bugs
///
/// When the image is stored as a planar configuration, this method will currently only read
/// the first sample's plane. This will be fixed in a future major version of `tiff`.
pub fn read_image(&mut self) -> TiffResult<DecodingResult> { pub fn read_image(&mut self) -> TiffResult<DecodingResult> {
let width = self.image().width; let width = self.image().width;
let height = self.image().height; let height = self.image().height;
@@ -1124,6 +1151,11 @@ impl<R: Read + Seek> Decoder<R> {
/// Returns a [`TiffError::UsageError`] if the chunk is smaller than the size indicated with a /// Returns a [`TiffError::UsageError`] if the chunk is smaller than the size indicated with a
/// call to [`Self::image_buffer_layout`]. Note that the alignment may be arbitrary, but an /// call to [`Self::image_buffer_layout`]. Note that the alignment may be arbitrary, but an
/// alignment smaller than the preferred alignment may perform worse. /// alignment smaller than the preferred alignment may perform worse.
///
/// # Bugs
///
/// When the image is stored as a planar configuration, this method will currently only read
/// the first sample's plane. This will be fixed in a future major version of `tiff`.
pub fn read_image_bytes(&mut self, buffer: &mut [u8]) -> TiffResult<()> { pub fn read_image_bytes(&mut self, buffer: &mut [u8]) -> TiffResult<()> {
let width = self.image().width; let width = self.image().width;
let height = self.image().height; let height = self.image().height;