velyan opened a new pull request, #147:
URL: https://github.com/apache/pdfbox/pull/147

   See[ Jira ticket 
](https://issues.apache.org/jira/browse/PDFBOX-5526?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=17618666#comment-17618666)
   
   When `PDImageXObject.getImage()` gets invoked with subsampling and region, 
internally it loads the entire mask into memory: 
https://github.com/apache/pdfbox/blob/961c052d52dd9ab2dd3d7cd762a5046e5cc85a91/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java#L465
   
   and applies the entire mask on the subsampled image.
   
   Which is extra work and can cause `OOM` exceptions. 
   
   The proposed optimisation is to pass `region` and `subsampling` params to 
`PDImageXObject.getOpaqueImage() `here - 
https://github.com/apache/pdfbox/blob/961c052d52dd9ab2dd3d7cd762a5046e5cc85a91/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java#L548
   
   such that masks are also subsampled before applying them...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to