[
https://issues.apache.org/jira/browse/PDFBOX-6003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949684#comment-17949684
]
Tilman Hausherr edited comment on PDFBOX-6003 at 5/6/25 11:31 AM:
------------------------------------------------------------------
Yes that 38884 x 30200 must be decompressed... I see you activated subsampling
but obviously this case is extreme.
was (Author: tilman):
>From what I see, there's a CCITT compressed image of 38884 x 30200 in that
>PDF. And yes it must be decompressed... I see you activated subsampling but
>obviously this case is extreme.
> Render image with DPI memory optimisation
> -----------------------------------------
>
> Key: PDFBOX-6003
> URL: https://issues.apache.org/jira/browse/PDFBOX-6003
> Project: PDFBox
> Issue Type: Wish
> Components: Rendering
> Affects Versions: 3.0.5 PDFBox
> Reporter: Michael
> Priority: Critical
> Attachments: image-2025-05-06-13-21-19-246.png,
> image-2025-05-06-13-21-19-281.png, image-2025-05-06-13-21-19-327.png
>
>
> In our PDF processing flow, where a customer could upload multi-page PDFs in
> different versions and resolutions, we encountered an OutOfMemory problem.
> The issue was, that the size of one of the images of a signature in a PDF
> page was 38884 to 30200. As a result, "SampledImageReader.getStencilImage"
> was trying to allocate *~4.5GB* of memory to convert a *1.7MB* single page
> PDF to an image.
> The initial page size from the PDFBox was 446 to 631 (points), the DPI for
> the image conversion was 200.
> Is there any reason for allocating the image buffer similar to the original
> image in the PDF?
> Wouldn't it be sufficient to follow the page size proportion and required
> DPI, and allocate an image buffer size accordingly?
>
> !image-2025-05-06-13-21-19-246.png|width=1050,height=459!!image-2025-05-06-13-21-19-281.png|width=1002,height=570!!image-2025-05-06-13-21-19-327.png|width=994,height=593!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]