From 8bfef5c5b7ee75b3525f576604cc6d0e79c50417 Mon Sep 17 00:00:00 2001 From: Julia Damerow Date: Thu, 1 Apr 2021 12:20:53 -0400 Subject: [PATCH] [GECO-128] udpated pdfbox version; catching runtime exception (#31) when turning pages into images --- cepheus/pom.xml | 4 ++-- .../cepheus/service/pdf/impl/ImageExtractionManager.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cepheus/pom.xml b/cepheus/pom.xml index 435b3bb..67dbad6 100644 --- a/cepheus/pom.xml +++ b/cepheus/pom.xml @@ -234,12 +234,12 @@ org.apache.pdfbox pdfbox - 2.0.20 + 2.0.23 org.apache.pdfbox pdfbox-tools - 2.0.20 + 2.0.23 com.github.jai-imageio diff --git a/cepheus/src/main/java/edu/asu/diging/gilesecosystem/cepheus/service/pdf/impl/ImageExtractionManager.java b/cepheus/src/main/java/edu/asu/diging/gilesecosystem/cepheus/service/pdf/impl/ImageExtractionManager.java index 77722a4..35226cc 100644 --- a/cepheus/src/main/java/edu/asu/diging/gilesecosystem/cepheus/service/pdf/impl/ImageExtractionManager.java +++ b/cepheus/src/main/java/edu/asu/diging/gilesecosystem/cepheus/service/pdf/impl/ImageExtractionManager.java @@ -143,8 +143,7 @@ public void extractImages(IImageExtractionRequest request) throws CepheusExtract requestPage.setContentType(pageImage.contentType); requestPage.setSize(pageImage.size); requestPage.setStatus(PageStatus.COMPLETE); - - } catch (IllegalArgumentException | IOException | NegativeArraySizeException e) { + } catch (IOException | RuntimeException e) { messageHandler.handleMessage("Could not render image.", e, MessageType.ERROR); requestPage.setStatus(PageStatus.FAILED); requestPage.setErrorMsg(e.getMessage());