-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MAINT: New LZW decoding implementation #2887
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2887 +/- ##
==========================================
- Coverage 96.27% 96.21% -0.06%
==========================================
Files 52 52
Lines 8689 8703 +14
Branches 1733 1733
==========================================
+ Hits 8365 8374 +9
- Misses 187 192 +5
Partials 137 137 ☔ View full report in Codecov by Sentry. |
@@ -365,131 +364,6 @@ def decode( | |||
return b"".join(lst) | |||
|
|||
|
|||
class LZWDecode: |
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 our deprecation policy requires to keep this compatibility layer until we release version 7.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.
I've added the class back, but the implementation now is the new _codecs.py one :-)
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.
Thanks. I have just removed some outdated comments. I guess we are going to keep the old class for now without any deprecation process?
Co-authored-by: Stefan <[email protected]>
@@ -41,12 +41,12 @@ | |||
from io import BytesIO | |||
from typing import Any, Dict, List, Optional, Tuple, Union, cast | |||
|
|||
from ._codecs._codecs import LzwCodec |
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 indirectly exposes both the internal and the external implementation as a public module, including the encoder. Do we really want to do this? I tend to either make this import local or private by adding as _LzwCodec
.
The basis for this implementation is https://github.com/empira/PDFsharp/blob/master/src/foundation/src/PDFsharp/src/PdfSharp/Pdf.Filters/LzwDecode.cs (MIT licensed)
As this removes the
LZWDecode
class from a public module, we have to do a major release when we release this change.