-
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
BUG: PDF size increases because of too high float writing precision #2213
Conversation
closes py-pdf#1910 address regression from py-pdf#2203
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2213 +/- ##
=======================================
Coverage 94.38% 94.38%
=======================================
Files 43 43
Lines 7588 7589 +1
Branches 1497 1497
=======================================
+ Hits 7162 7163 +1
Misses 262 262
Partials 164 164
☔ View full report in Codecov by Sentry. |
I just made a little test:
The output is:
For comparison:
Most interesting is that I wasn't able to spot a difference. |
From my analysis, you should not put a value lower than 5 : If you take some colorspace which are using some FloatObject, you may get some too big rounding that will affect the colors and which may not be visible on most of the pdf viewers. |
@@ -379,6 +379,9 @@ def readFromStream( | |||
return IndirectObject.read_from_stream(stream, pdf) | |||
|
|||
|
|||
FLOAT_WRITE_PRECISION = 8 # shall be min 5 digits max, allow user adj |
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.
Some part of the comment seems to have got lost.
## What's new ### Bug Fixes (BUG) - PDF size increases because of too high float writing precision (#2213) by @pubpub-zz - Fix test_watermarking_reportlab_rendering() (#2203) by @LucasCimon ### Documentation (DOC) - Fix typos and add a paragraph to ViewerPreferences docs (#2199) by @marcstober - How to install pypi from any branch (#2209) by @pubpub-zz - Update copyright footer in docs (#2207) by @marcstober ### Developer Experience (DEV) - Let dependabot update Github Actions by @MartinThoma ### Maintenance (MAINT) - Update .pre-commit-config.yaml by @MartinThoma [Full Changelog](3.16.1...3.16.2)
closes #1910
address regression from #2203