-
-
Notifications
You must be signed in to change notification settings - Fork 888
Allow inferring of some PngEncoderOptions #1019
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
Conversation
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.
@Sheyne thanks for the contribution! Generally, it looks good, but there are two blockers to be resolved in order to allow it through our QA gate:
- StyleCop findings shall be fixed. Hint: in release mode warnings are shown as errors.
- We need test cases for the new feature, so we can change the implementation without introducing a regression.
Suggestion: a variant of PngEncoderTests.WorksWithAllBitDepths:
- Without passing
PngColorTypeandPngBitDepthas argument, lettingPngEncoderto infer it - We need to make sure that all cases are covered, including the handling of the alpha channel
- Instead of using test pattern, a blank image could be manipulated in a way similar to the reproduction steps in #1016. The
[WithBlankImages]attribute could be utilized:
[WithBlankImages(2, 2, PixelTypes.Rgb24 | PixelTypes.Rgba32 | PixelTypes.Gray16 | ...)]It's kinda tricky to do Rgba64 -> TPixel conversions at the moment. The following code snippet may help:
Rgba64 rgba = new Rgba64(2017, 2017, 2017, 43777);
TPixel pixel = ((Color)rgba).ToPixel<TPixel>();
image[0, 0] = pixel;UPDATE: Made a simplification
|
For some reason the project isn't building on my machine, so I can't run the test suite locally. I'm hoping that the CI test checks it okay. Is there some dependency I need to install? |
|
@Sheyne What build issues are you seeing? The CI builds are working but we've got failing tests related to your changes. https://ci.appveyor.com/project/six-labors/imagesharp/builds/27856181/job/njb2lp2nsiy4ntfq/tests |
Codecov Report
@@ Coverage Diff @@
## master #1019 +/- ##
==========================================
- Coverage 89.86% 81.49% -8.38%
==========================================
Files 1099 704 -395
Lines 48843 29381 -19462
Branches 3441 3289 -152
==========================================
- Hits 43895 23944 -19951
- Misses 4246 4745 +499
+ Partials 702 692 -10
Continue to review full report at Codecov.
|
|
Ignore the codecov report here. The system is still trying to get on track and comparing to the old coverage calculations. |
|
@Sheyne Please accept my apologies for replying to you so late. This issue got swept to the side while we went through a massive code reorganization process. Regarding your build issues. Your problem was due to the lack of submodules installed in the repository. I've updated the readme since you started to make it more clear how to get everything up and running. |
brianpopow
left a comment
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.
looks good
Prerequisites
Description
Before going though all the prereqs since I'm new to this project I'm creating this to discuss #1016 further
Note that theswitchapproach isn't possible becauseTypes aren't compile time constants. If statements should work thoughPossible now we have access to C# 8 😄