-
-
Notifications
You must be signed in to change notification settings - Fork 888
Added: ability to skip unneeded chunks for optimization mode #1012
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
Changes from 10 commits
9d62a2c
69f01c3
9ee2066
8d9fbb7
81bc719
fc8f5e3
ba08c64
f8c5277
6e3e4ce
6259881
d68d7bd
6765f96
f257ef2
f04e836
624591c
a86713f
8ca9b97
c386f9d
200ef9f
f9c2f6a
0f581ab
bc7eb27
ec3656f
749f68a
129b639
b69d772
b817615
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Copyright (c) Six Labors and contributors. | ||
| // Licensed under the Apache License, Version 2.0. | ||
|
|
||
| using System; | ||
|
|
||
| namespace SixLabors.ImageSharp.Formats.Png | ||
| { | ||
| /// <summary> | ||
| /// Provides enumeration of available PNG optimization methods. | ||
| /// </summary> | ||
| [Flags] | ||
| public enum PngOptimizeMethod | ||
| { | ||
| /// <summary> | ||
| /// With the None filter, the scanline is transmitted unmodified. | ||
| /// </summary> | ||
| None = 0, | ||
|
|
||
| /// <summary> | ||
| /// Suppress the physical dimension information chunk. | ||
| /// </summary> | ||
| SuppressPhysicalChunk = 1, | ||
|
|
||
| /// <summary> | ||
| /// Suppress the gamma information chunk. | ||
| /// </summary> | ||
| SuppressGammaChunk = 2, | ||
|
|
||
| /// <summary> | ||
| /// Suppress the eXIf chunk. | ||
| /// </summary> | ||
| SuppressExifChunk = 4, | ||
|
|
||
| /// <summary> | ||
| /// Suppress the tTXt, iTXt or zTXt chunk. | ||
| /// </summary> | ||
| SuppressTextChunks = 8, | ||
|
|
||
| /// <summary> | ||
| /// Make funlly transparent pixels black. | ||
| /// </summary> | ||
| MakeTransparentBlack = 16, | ||
|
||
|
|
||
| /// <summary> | ||
| /// All possible optimizations. | ||
| /// </summary> | ||
| All = 31, | ||
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
As I mentioned on gitter, it's better if our naming should reflect functional semantics rather than a specific use case (optimization).
In that case "positive" flags may be easier than negative ones expressing the suppression."positive" flags may be better than negative ones, but I'm not sure about this, need @JimBobSquarePants 's advice.SuggestionPositive flags:Negative flags:
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.
I much prefer the suggested naming definition.
The overall metadata API is designed to preserve as much metadata as possible so I think we should adopt the negative flags. This to me as a consumer would cognitively reflect that intention as I'm building a rule for what to exclude.
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.
this is changed now to negative flags