]> source.dussan.org Git - poi.git/commitdiff
PPTX2PNG - don't complain about missing output dir, when in testing mode
authorAndreas Beeker <kiwiwings@apache.org>
Sun, 5 Jun 2016 10:18:14 +0000 (10:18 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Sun, 5 Jun 2016 10:18:14 +0000 (10:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1746893 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java

index 83d944bf2240a8a3295d6ef368faf5009564a715..76d1b5900624e06337ae5a1f9e2f19c465f8bb56 100644 (file)
@@ -94,11 +94,16 @@ public class PPTX2PNG {
             return;\r
         }\r
 \r
+        if (format == null || !format.matches("^(png|gif|jpg|null)$")) {\r
+            usage("Invalid format given");\r
+            return;\r
+        }\r
+    \r
         if (outdir == null) {\r
             outdir = file.getParentFile();\r
         }\r
         \r
-        if (outdir == null || !outdir.exists() || !outdir.isDirectory()) {\r
+        if (!"null".equals(format) && (outdir == null || !outdir.exists() || !outdir.isDirectory())) {\r
             usage("Output directory doesn't exist");\r
             return;\r
         }\r
@@ -108,11 +113,6 @@ public class PPTX2PNG {
             return;\r
         }\r
         \r
-        if (format == null || !format.matches("^(png|gif|jpg|null)$")) {\r
-            usage("Invalid format given");\r
-            return;\r
-        }\r
-    \r
         if (!quiet) {\r
             System.out.println("Processing " + file);\r
         }\r