This repository was archived by the owner on Jan 2, 2023. It is now read-only.
Use smart-growing buffer size for compression#28
Open
pchk wants to merge 1 commit intowkhtmltopdf:wk_4.8.7from
Open
Use smart-growing buffer size for compression#28pchk wants to merge 1 commit intowkhtmltopdf:wk_4.8.7from
pchk wants to merge 1 commit intowkhtmltopdf:wk_4.8.7from
Conversation
Usally buffer size that fits all compressed data is much lesser that source uncompressed data size. This routine has initial size of buffer = 10mb. Usually is is enough to compress any image that comes to a printer. In the worst case the buffer will grow up to :;compressBound result thats guarantees to fit all compressed data. Ex: In pdf_fail.html(235kb) metioned in wkhtmltopdf/wkhtmltopdf#2684 nonScaled image ~300mb, real buffer size needed for compression will be ~3mb.
|
|
||
| }; | ||
|
|
||
| bool QPdfEnginePrivate::smartCompressDeflate(const char *source, int size, QByteArray& compressed, unsigned long maxSize) |
Member
There was a problem hiding this comment.
Make this a static function, as it's unlikely to be used outside of this file.
Member
|
Please address the review comments and amend/rebase the changes, so that I can merge all the PRs together. Thanks for the detailed commit messages! |
Member
|
@pchk: any idea when you would be able to address the review comments? |
39 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Usally buffer size that fits all compressed data is much lesser that
source uncompressed data size.
This routine has initial size of buffer = 10mb. Usually is is enough to
compress any image that comes to a printer. In the worst case the buffer
will grow up to :;compressBound result thats guarantees to fit all
compressed data.
Ex:
In pdf_fail.html(235kb) metioned in wkhtmltopdf/wkhtmltopdf#2684 nonScaled image
~300mb, real buffer size needed for compression will be ~3mb.