-
-
Notifications
You must be signed in to change notification settings - Fork 888
Add support for decoding tiff's with T.6 fax compression #1747
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
Codecov Report
@@ Coverage Diff @@
## master #1747 +/- ##
========================================
Coverage 84.44% 84.44%
========================================
Files 836 841 +5
Lines 36748 37006 +258
Branches 4306 4343 +37
========================================
+ Hits 31032 31251 +219
- Misses 4883 4903 +20
- Partials 833 852 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
JimBobSquarePants
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.
I won't lie, I did not read the specification. 😝
Can't see any code issues though, just a nice to have and a question.
| { | ||
| internal enum CcittTwoDimensionalCodeType | ||
| { | ||
| None = 0, |
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.
It would be nice to have enumerations like this documented even if they're internal.
| /// <returns>The value read.</returns> | ||
| protected uint ReadValue(int nBits) | ||
| { | ||
| Guard.MustBeGreaterThan(nBits, 0, nameof(nBits)); |
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.
How often is this called. The Guard might be a performance killer
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.
its called very often, its DebugGuard now
| /// <summary> | ||
| /// Class to handle cases where TIFF image data is compressed using CCITT T6 compression. | ||
| /// </summary> | ||
| internal class T6TiffCompression : TiffBaseDecompressor |
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 this can be sealed let's make a habit of doing so.
| /// <returns>Position of b1.</returns> | ||
| public int FindB1(int a0, byte a0Byte) | ||
| { | ||
| if (this.scanLine.IsEmpty) |
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.
Nit:
| if (this.scanLine.IsEmpty) | |
| if (this.IsEmpty) |
if the property is at hands?
| /// <returns>Position of b1.</returns> | ||
| public int FindB2(int b1) | ||
| { | ||
| if (this.scanLine.IsEmpty) |
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.
Same here.
src/ImageSharp/Formats/Tiff/Compression/Decompressors/ModifiedHuffmanBitReader.cs
Outdated
Show resolved
Hide resolved
src/ImageSharp/Formats/Tiff/Compression/Decompressors/ModifiedHuffmanBitReader.cs
Outdated
Show resolved
Hide resolved
src/ImageSharp/Formats/Tiff/Compression/Decompressors/T6BitReader.cs
Outdated
Show resolved
Hide resolved
src/ImageSharp/Formats/Tiff/Compression/Decompressors/T6TiffCompression.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Günther Foidl <gue@korporal.at>
Prerequisites
Description
This PR adds support for decoding tiff image with ccitt T.6 fax compression (some call the compression fax4).
For the specification see pdf
T-REC-T.6-198811in the Tiff folder.