pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1576071 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/TIFFUtil.java
Date Mon, 10 Mar 2014 20:36:32 GMT
Author: tilman
Date: Mon Mar 10 20:36:32 2014
New Revision: 1576071

URL: http://svn.apache.org/r1576071
Log:
PDFBOX-1963: fix if statement that had switched branches

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/TIFFUtil.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/TIFFUtil.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/TIFFUtil.java?rev=1576071&r1=1576070&r2=1576071&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/TIFFUtil.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/TIFFUtil.java Mon Mar 10 20:36:32
2014
@@ -25,9 +25,7 @@ import javax.imageio.metadata.IIOMetadat
 import javax.imageio.metadata.IIOMetadataNode;
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import java.awt.image.BufferedImage;
@@ -87,15 +85,15 @@ class TIFFUtil
         IIOMetadataNode ifd;
         if (root.getElementsByTagName("TIFFIFD").getLength() == 0)
         {
-            ifd = (IIOMetadataNode)root.getElementsByTagName("TIFFIFD").item(0);
-        }
-        else
-        {
             ifd = new IIOMetadataNode("TIFFIFD");
             ifd.setAttribute("tagSets",
                              "com.sun.media.imageio.plugins.tiff.BaselineTIFFTagSet");
             root.appendChild(ifd);
         }
+        else
+        {
+            ifd = (IIOMetadataNode)root.getElementsByTagName("TIFFIFD").item(0);
+        }
 
         // standard metadata does not work, so we set the DPI manually
         ifd.appendChild(createRationalField(282, "XResolution", dpi, 1));



Mime
View raw message