Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

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

Fixes #935

Rather than throwing when ColorType/BitDepth options are passed that are not supported by the PNG specification we can use PngBitDepth.Bit8 to fix up the options.

This bit depth is the only one supported by all color type values.

@JimBobSquarePants JimBobSquarePants added this to the 1.1.0 milestone Oct 20, 2020
@JimBobSquarePants JimBobSquarePants requested a review from a team October 20, 2020 17:46
@codecov
Copy link

codecov bot commented Oct 20, 2020

Codecov Report

Merging #1395 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1395      +/-   ##
==========================================
+ Coverage   82.87%   82.88%   +0.01%     
==========================================
  Files         690      690              
  Lines       30903    30903              
  Branches     3545     3544       -1     
==========================================
+ Hits        25610    25614       +4     
+ Misses       4572     4570       -2     
+ Partials      721      719       -2     
Flag Coverage Δ
#unittests 82.88% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs 92.40% <100.00%> (+5.06%) ⬆️

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 60eba39...d4fb78b. Read the comment docs.

Copy link
Collaborator

@brianpopow brianpopow left a comment

Choose a reason for hiding this comment

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

looks good

@JimBobSquarePants JimBobSquarePants merged commit 77a59ee into master Oct 21, 2020
@JimBobSquarePants JimBobSquarePants deleted the js/fix-935 branch October 21, 2020 10:19
JimBobSquarePants added a commit that referenced this pull request Mar 13, 2021
Auto repair Png options to use Bit8.
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.

"Bit depth is not supported or not valid" on saving PNG

2 participants