pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1684472 - /pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java
Date Tue, 09 Jun 2015 16:34:03 GMT
Author: tilman
Date: Tue Jun  9 16:34:03 2015
New Revision: 1684472

URL: http://svn.apache.org/r1684472
Log:
PDFBOX-2576: Don't throw a RuntimeException for an IIOInvalidTreeException that "should never
happen".

Modified:
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java?rev=1684472&r1=1684471&r2=1684472&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java Tue
Jun  9 16:34:03 2015
@@ -289,6 +289,7 @@ public final class ImageIOUtil
 
     // sets the DPI metadata
     private static void setDPI(IIOMetadata metadata, int dpi, String formatName)
+            throws IIOInvalidTreeException
     {
         IIOMetadataNode root = (IIOMetadataNode) metadata.getAsTree(MetaUtil.STANDARD_METADATA_FORMAT);
 
@@ -309,14 +310,6 @@ public final class ImageIOUtil
         child = getOrCreateChildNode(dimension, "VerticalPixelSize");
         child.setAttribute("value", Double.toString(res));
 
-        try
-        {
-            metadata.mergeTree(MetaUtil.STANDARD_METADATA_FORMAT, root);
-        }
-        catch (IIOInvalidTreeException e)
-        {
-            // should never happen
-            throw new RuntimeException(e);
-        }
+        metadata.mergeTree(MetaUtil.STANDARD_METADATA_FORMAT, root);
     }
 }



Mime
View raw message