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

TiffEncoder: Avoid buffer2D.GetSingleSpan() and use GetPixelRowSpan instead #1662

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

brianpopow
Copy link
Collaborator

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

As made clear with #1660 the usage of buffer2D.GetSingleSpan() is problematic and not always guaranteed to return a complete span. This PR will change the Tiff Encoder to avoid the usage of buffer2D.GetSingleSpan() and use GetPixelRowSpan instead.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

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

Wow! That was quick! 😍

@codecov
Copy link

codecov bot commented Jun 14, 2021

Codecov Report

Merging #1662 (bcb3b7d) into master (261c868) will increase coverage by 0.01%.
The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1662      +/-   ##
==========================================
+ Coverage   84.31%   84.32%   +0.01%     
==========================================
  Files         816      816              
  Lines       35824    35856      +32     
  Branches     4160     4167       +7     
==========================================
+ Hits        30204    30235      +31     
  Misses       4799     4799              
- Partials      821      822       +1     
Flag Coverage Δ
unittests 84.32% <96.42%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ts/Tiff/Compression/Compressors/T4BitCompressor.cs 92.33% <ø> (ø)
...ormats/Tiff/Writers/TiffBaseColorWriter{TPixel}.cs 95.45% <ø> (-0.11%) ⬇️
.../Formats/Tiff/Writers/TiffPaletteWriter{TPixel}.cs 97.10% <90.90%> (-1.15%) ⬇️
.../Formats/Tiff/Writers/TiffBiColorWriter{TPixel}.cs 95.74% <100.00%> (+1.62%) ⬆️
...s/Tiff/Writers/TiffCompositeColorWriter{TPixel}.cs 94.73% <100.00%> (+3.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eab4ed9...bcb3b7d. Read the comment docs.

@brianpopow brianpopow merged commit 5966a2e into master Jun 14, 2021
@brianpopow brianpopow deleted the bp/tiffavoidsinglespan branch June 14, 2021 15:48
@IldarKhayrutdinov
Copy link
Contributor

@brianpopow @JimBobSquarePants @antonfirsov sorry, I'm a distracted, great work @brianpopow 👍

@JimBobSquarePants
Copy link
Member

No worries @IldarKhayrutdinov we move fast! 😀

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.

3 participants