mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
Properly close PDF snapshots loaded with pdfbox library
This commit is contained in:
parent
74e6d6e984
commit
4d8a948455
|
@ -348,8 +348,8 @@ public class Html2Image {
|
|||
|
||||
// convert pdf to jpg using internal pdfbox capability
|
||||
if (convertCmd == null) {
|
||||
try {
|
||||
PDDocument pdoc = PDDocument.load(pdf);
|
||||
try (final PDDocument pdoc = PDDocument.load(pdf);) {
|
||||
|
||||
BufferedImage bi = new PDFRenderer(pdoc).renderImageWithDPI(0, density, ImageType.RGB);
|
||||
|
||||
return ImageIO.write(bi, imageFormat, image);
|
||||
|
|
Loading…
Reference in New Issue
Block a user