-
-
Notifications
You must be signed in to change notification settings - Fork 887
Throw NotSupportedException for arithmetic coding and lossless jpeg's #1742
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 all commits
59a8449
1ab5185
27cbafe
10b0557
1000dfb
d1fe136
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 |
|---|---|---|
|
|
@@ -8,6 +8,13 @@ namespace SixLabors.ImageSharp.Formats.Jpeg | |
| { | ||
| internal static class JpegThrowHelper | ||
| { | ||
| /// <summary> | ||
| /// Cold path optimization for throwing <see cref="NotSupportedException"/>'s. | ||
| /// </summary> | ||
| /// <param name="errorMessage">The error message for the exception.</param> | ||
| [MethodImpl(InliningOptions.ColdPath)] | ||
| public static void ThrowNotSupportedException(string errorMessage) => throw new NotSupportedException(errorMessage); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we throw Ideally, we need to make sure to document all exceptions we throw on
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we throw
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great to see the docs fixed in I would also change the docs in /// <exception cref="NotSupportedException">The stream is not readable. -or- The image format is not supported.</exception> |
||
|
|
||
| /// <summary> | ||
| /// Cold path optimization for throwing <see cref="InvalidImageContentException"/>'s. | ||
| /// </summary> | ||
|
|
||
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.
note: there are also 0xC5 and 0xC6 StartOfFrame markers for Differential progressive DCT and Differential sequential DCT. I could not find any real life examples of those, so I was unsure if I should add those here too.
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.
Afaik arithmetic coding is not very common (at least for general internet use case) as it's harder to compute and storage gain is not really better than DCT one. Adding yet another rare format just for 'why-not-ness' won't break anything as it's internal or kill the performance. So, why not?
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.
If anyone gets bored they could copy implementations of the missing decoder functionality from here.
https://github.com/yigolden/JpegLibrary
They copied a bunch of stuff from us so all fair.