BUG: PDF size increases because of too high float writing precision#2213
Merged
MartinThoma merged 1 commit intopy-pdf:mainfrom Sep 24, 2023
Merged
BUG: PDF size increases because of too high float writing precision#2213MartinThoma merged 1 commit intopy-pdf:mainfrom
MartinThoma merged 1 commit intopy-pdf:mainfrom
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. |
Member
|
I just made a little test: The output is: For comparison: Most interesting is that I wasn't able to spot a difference. |
Collaborator
Author
|
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. |
MartinThoma
reviewed
Sep 24, 2023
MartinThoma
reviewed
Sep 24, 2023
| return IndirectObject.read_from_stream(stream, pdf) | ||
|
|
||
|
|
||
| FLOAT_WRITE_PRECISION = 8 # shall be min 5 digits max, allow user adj |
Collaborator
There was a problem hiding this comment.
Some part of the comment seems to have got lost.
MartinThoma
added a commit
that referenced
this pull request
Sep 24, 2023
## 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1910
address regression from #2203