Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

@JimBobSquarePants JimBobSquarePants commented Apr 26, 2025

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Uses the computed BitsPerPixel from the color writer instance for the compressor to ensure parity.

Fixes #2909

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that the compressor uses the calculated BitsPerPixel from the Color Writer, aligning the encoder behavior with the computed image properties.

  • Added a constant for Issue2909 in the test images.
  • Introduced two new tests verifying LZW and Deflate compressions using the Issue2909 test image.
  • Refactored the TiffEncoderCore compressor creation to use colorWriter.BitsPerPixel instead of an external bitsPerPixel value.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
tests/ImageSharp.Tests/TestImages.cs Added a new constant for Issue2909 test image reference.
tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs Added new tests for LZW and Deflate compression support.
src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs Refactored compressor instantiation to use the color writer’s BitsPerPixel.
Files not reviewed (1)
  • tests/Images/Input/Tiff/Issues/Issue2909.tiff: Language not supported

@JimBobSquarePants JimBobSquarePants merged commit 22a06d6 into main Apr 26, 2025
22 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-2909 branch April 26, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saving an example tiff file back to disk using the default TiffEncoder settings changes the image

2 participants