You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2018/09/01 10:03:00 UTC
[jira] [Commented] (PDFBOX-4300) Reduce im memory buffers when
creating grayscale images
[ https://issues.apache.org/jira/browse/PDFBOX-4300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16599597#comment-16599597 ]
Tilman Hausherr commented on PDFBOX-4300:
-----------------------------------------
I did look at the patch but I haven't tested it, I'd like to wait until you have the rest too. But you're right that the existing code can be optimized, and your approach looks good to me.
> Reduce im memory buffers when creating grayscale images
> -------------------------------------------------------
>
> Key: PDFBOX-4300
> URL: https://issues.apache.org/jira/browse/PDFBOX-4300
> Project: PDFBox
> Issue Type: Improvement
> Components: PDModel
> Affects Versions: 2.0.11
> Reporter: Jesse Long
> Priority: Minor
> Attachments: PDFBOX-4300-1.patch
>
>
> LosslessFactory uses ByteArrayOutputStreams when creating PDF image data. First, it creates a BAOS in which to store the data, then a BAOS in which to store the flate encoded data. Finally the flate encoded data is written to the PDImageXObject's stream.
> We could instead create an empty PDStream, give it a filter, and write the image data directly into the stream. We then instantiate a PDImageXObject giving it the already created stream.
> This would dramatically reduce RAM requirement if a scratchfile is in play.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org