]> source.dussan.org Git - poi.git/commitdiff
add extra max size config
authorPJ Fanning <fanningpj@apache.org>
Sat, 19 Feb 2022 21:08:48 +0000 (21:08 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 19 Feb 2022 21:08:48 +0000 (21:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898234 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java
poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java

index 4f26afdb2dfee776b929c70423a6786bbbf8815b..2eb65bef8cd54e203208f8d6bb1373ccd80561f6 100644 (file)
@@ -86,10 +86,16 @@ public class TSPTimeStampService implements TimeStampService {
     private static final int DEFAULT_TIMESTAMP_RESPONSE_SIZE = 10_000_000;
     private static int MAX_TIMESTAMP_RESPONSE_SIZE = DEFAULT_TIMESTAMP_RESPONSE_SIZE;
 
+    /**
+     * @param maxTimestampResponseSize the max timestamp response size allowed
+     */
     public static void setMaxTimestampResponseSize(int maxTimestampResponseSize) {
         MAX_TIMESTAMP_RESPONSE_SIZE = maxTimestampResponseSize;
     }
 
+    /**
+     * @return the max timestamp response size allowed
+     */
     public static int getMaxTimestampResponseSize() {
         return MAX_TIMESTAMP_RESPONSE_SIZE;
     }
index 85512059a751c995dfc656784e93c4cc82083d20..fbc96682037e06aa625190f406da1ce841175802 100644 (file)
@@ -572,7 +572,7 @@ public class XMLSlideShow extends POIXMLDocument
      */
     @Override
     public XSLFPictureData addPicture(InputStream is, PictureType format) throws IOException {
-        return addPicture(IOUtils.toByteArray(is, MAX_IMAGE_SIZE), format);
+        return addPicture(IOUtils.toByteArray(is, getMaxImageSize()), format);
     }