Skip to content

Adds support for OS/2 version 2 bitmaps - #813

Merged
JimBobSquarePants merged 4 commits into
SixLabors:masterfrom
brianpopow:feature/BitmapOS2v2
Jan 23, 2019
Merged

JimBobSquarePants merged 4 commits into
SixLabors:masterfrom
brianpopow:feature/BitmapOS2v2

Conversation

@brianpopow

Copy link
Copy Markdown
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 matches 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

This PR adds support for decoding OS/2 version 2 bitmaps (at least partially). OS/2 v2 introduces additional compression type of RLE24 and 1D Huffman, which is not supported.

I had some trouble finding actual example images for this. I have only one with no compression. RLE4 and RLE8 should work, too, but i could not find those.

@codecov

codecov Bot commented Jan 20, 2019

Copy link
Copy Markdown

Codecov Report

Merging #813 into master will decrease coverage by <.01%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #813      +/-   ##
==========================================
- Coverage   88.75%   88.74%   -0.01%     
==========================================
  Files        1014     1014              
  Lines       44048    44079      +31     
  Branches     3175     3178       +3     
==========================================
+ Hits        39093    39117      +24     
- Misses       4229     4234       +5     
- Partials      726      728       +2
Impacted Files Coverage Δ
tests/ImageSharp.Tests/TestImages.cs 100% <ø> (ø) ⬆️
...ts/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs 98.86% <100%> (+0.05%) ⬆️
src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs 83.48% <71.42%> (-0.24%) ⬇️
src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs 71.12% <71.42%> (+0.05%) ⬆️
src/ImageSharp/Formats/Bmp/BmpFileHeader.cs 84.61% <0%> (+7.69%) ⬆️

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 1b9979c...fe523e7. Read the comment docs.

@codecov

codecov Bot commented Jan 20, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #813 into master will decrease coverage by 0.01%.
The diff coverage is 62.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #813      +/-   ##
==========================================
- Coverage   88.75%   88.73%   -0.02%     
==========================================
  Files        1014     1015       +1     
  Lines       44048    44081      +33     
  Branches     3175     3178       +3     
==========================================
+ Hits        39093    39117      +24     
- Misses       4229     4236       +7     
- Partials      726      728       +2
Impacted Files Coverage Δ
tests/ImageSharp.Tests/TestImages.cs 100% <ø> (ø) ⬆️
src/ImageSharp/Formats/Bmp/BmpThrowHelper.cs 0% <0%> (ø)
...ts/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs 98.86% <100%> (+0.05%) ⬆️
src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs 83.48% <50%> (-0.24%) ⬇️
src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs 71.12% <71.42%> (+0.05%) ⬆️
src/ImageSharp/Formats/Bmp/BmpFileHeader.cs 84.61% <0%> (+7.69%) ⬆️

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 1b9979c...e1d38ef. Read the comment docs.

@JimBobSquarePants

Copy link
Copy Markdown
Member

@brianpopow Those new exceptions are going to start to hurt performance and coverage. Would it be possible for you to refactor them out into a static BmpThrowHelper class like the ThrowHelper class in the jpeg decoder?

@JimBobSquarePants

Copy link
Copy Markdown
Member

Merged. Thanks again, couldn't do this without you!

@JimBobSquarePants
JimBobSquarePants merged commit b03d41b into SixLabors:master Jan 23, 2019
antonfirsov pushed a commit to antonfirsov/ImageSharp that referenced this pull request Nov 11, 2019
* Added support for OS/2 version 2 bitmaps

* throw NotSupportedException, if the file header type is not BM

* renamed Os2v2 to Os2v2Size

* Added BmpThrowHelper similar to the JpegThrowHelper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants