You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2026/10/11 13:09:16 UTC
(poi) branch trunk updated: PPTX2PNG: check the output directory once (#1385)
This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git
The following commit(s) were added to refs/heads/trunk by this push:
new f3688f45b0 PPTX2PNG: check the output directory once (#1385)
f3688f45b0 is described below
commit f3688f45b0de8934fb32736ba14efc5bbca4a580
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Sun Oct 11 14:09:10 2026 +0100
PPTX2PNG: check the output directory once (#1385)
The first check required the outdir to exist even for -format null, which
writes no files, so the second check's exemption for null never applied,
and the first check didn't verify it was a directory.
Co-authored-by: Claude Opus 5.5 <no...@anthropic.com>
---
poi-ooxml/src/main/java/org/apache/poi/xslf/util/PPTX2PNG.java | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/util/PPTX2PNG.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/util/PPTX2PNG.java
index 914624e889..bbf865b599 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xslf/util/PPTX2PNG.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/util/PPTX2PNG.java
@@ -259,13 +259,9 @@ public final class PPTX2PNG {
outdir = file.getAbsoluteFile().getParentFile();
}
}
- if (!outdir.exists()) {
- usage("Outdir doesn't exist");
- return false;
- }
-
- if (!"null".equals(format) && (outdir == null || !outdir.exists() || !outdir.isDirectory())) {
- usage("Output directory doesn't exist");
+ // the "null" format writes no files, so it doesn't need the output directory
+ if (!"null".equals(format) && (!outdir.exists() || !outdir.isDirectory())) {
+ usage("Output directory doesn't exist or isn't a directory");
return false;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org