[
https://issues.apache.org/jira/browse/PDFBOX-5876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113127#comment-18113127
]
Tilman Hausherr commented on PDFBOX-5876:
-----------------------------------------
I don't know, copilot didn't complain. What I did notice is that the reading is
done before the wait, so I assume the reading blocks until done, before the
wait is called. This is just test code so it will run fine, and if it blocks
we'll know the test has failed. I remember that people usually use a "stream
gobbler" that runs in parallel.
Apache Tika has it:
https://github.com/apache/tika/blob/main/tika-core/src/main/java/org/apache/tika/utils/ProcessUtils.java
this is in the tika-core artifact.
> This jpeg2000 takes up a lot of memory, causing overflow.
> ---------------------------------------------------------
>
> Key: PDFBOX-5876
> URL: https://issues.apache.org/jira/browse/PDFBOX-5876
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.32, 3.0.2 PDFBox
> Reporter: liu
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 2.0.38, 3.0.9 PDFBox, 4.0.0
>
> Attachments: PDFJS-16782-SMaskInData.pdf, PDImageXObject.java,
> jpeg2000.pdf
>
>
> pdf:[^jpeg2000.pdf]
> JVM:-Xmx600m
> {code:java}
> //代码占位符
> public static void main(String[] args) throws IOException,
> InterruptedException {
> File file = new File("C:\\Users\\LYCIT\\Downloads\\jpeg2000.pdf");
> PDDocument pdf = Loader.loadPDF(file,
> IOUtils.createTempFileOnlyStreamCache());
> PDFRenderer renderer = new PDFRenderer(pdf);
> int numPages = 0;
> renderer.setSubsamplingAllowed(true);
> BufferedImage bi = renderer.renderImage(numPages, 0.5f);
> pdf.close();
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]