diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java index f19a3bc06..b8c7d94ff 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java @@ -950,6 +950,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction /** The key of the configuration. e.g. svg,html,css,js */ String THUMBNAIL_HTML_IMAGE_EXCLUDE_EXTENSIONS = "thumbnail.html.image.exclude.extensions"; + /** The key of the configuration. e.g. true */ + String THUMBNAIL_HTML_IMAGE_GENERATOR_VALIDATION = "thumbnail.html.image.generator.validation"; + /** The key of the configuration. e.g. 0 */ String THUMBNAIL_GENERATOR_INTERVAL = "thumbnail.generator.interval"; @@ -4529,6 +4532,20 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction */ String getThumbnailHtmlImageExcludeExtensions(); + /** + * Get the value for the key 'thumbnail.html.image.generator.validation'.
+ * The value is, e.g. true
+ * @return The value of found property. (NotNull: if not found, exception but basically no way) + */ + String getThumbnailHtmlImageGeneratorValidation(); + + /** + * Is the property for the key 'thumbnail.html.image.generator.validation' true?
+ * The value is, e.g. true
+ * @return The determination, true or false. (if not found, exception but basically no way) + */ + boolean isThumbnailHtmlImageGeneratorValidation(); + /** * Get the value for the key 'thumbnail.generator.interval'.
* The value is, e.g. 0
@@ -7502,6 +7519,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction return get(FessConfig.THUMBNAIL_HTML_IMAGE_EXCLUDE_EXTENSIONS); } + public String getThumbnailHtmlImageGeneratorValidation() { + return get(FessConfig.THUMBNAIL_HTML_IMAGE_GENERATOR_VALIDATION); + } + + public boolean isThumbnailHtmlImageGeneratorValidation() { + return is(FessConfig.THUMBNAIL_HTML_IMAGE_GENERATOR_VALIDATION); + } + public String getThumbnailGeneratorInterval() { return get(FessConfig.THUMBNAIL_GENERATOR_INTERVAL); } @@ -8543,6 +8568,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_FORMAT, "png"); defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_XPATH, "//IMG"); defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_EXCLUDE_EXTENSIONS, "svg,html,css,js"); + defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_GENERATOR_VALIDATION, "true"); defaultMap.put(FessConfig.THUMBNAIL_GENERATOR_INTERVAL, "0"); defaultMap.put(FessConfig.THUMBNAIL_GENERATOR_TARGETS, "all"); defaultMap.put(FessConfig.THUMBNAIL_CRAWLER_ENABLED, "true"); diff --git a/src/main/java/org/codelibs/fess/thumbnail/impl/HtmlTagBasedGenerator.java b/src/main/java/org/codelibs/fess/thumbnail/impl/HtmlTagBasedGenerator.java index c8ca892f6..c61ea8cad 100644 --- a/src/main/java/org/codelibs/fess/thumbnail/impl/HtmlTagBasedGenerator.java +++ b/src/main/java/org/codelibs/fess/thumbnail/impl/HtmlTagBasedGenerator.java @@ -151,7 +151,7 @@ public class HtmlTagBasedGenerator extends BaseThumbnailGenerator { final ImageReadParam param = reader.getDefaultReadParam(); final int width = reader.getWidth(0); final int height = reader.getHeight(0); - if (!fessConfig.validateThumbnailSize(width, height)) { + if (fessConfig.isThumbnailHtmlImageGeneratorValidation() && !fessConfig.validateThumbnailSize(width, height)) { return Result.INVALID_SIZE; } final int samplingWidth = width / fessConfig.getThumbnailHtmlImageThumbnailWidthAsInteger(); diff --git a/src/main/resources/fess_config.properties b/src/main/resources/fess_config.properties index dfc5003fe..86d221186 100644 --- a/src/main/resources/fess_config.properties +++ b/src/main/resources/fess_config.properties @@ -500,6 +500,7 @@ thumbnail.html.image.thumbnail.height=100 thumbnail.html.image.format=png thumbnail.html.image.xpath=//IMG thumbnail.html.image.exclude.extensions=svg,html,css,js +thumbnail.html.image.generator.validation=true thumbnail.generator.interval=0 thumbnail.generator.targets=all thumbnail.crawler.enabled=true