From d6c36e1012872a8813b7111b07a21a31506159be Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sun, 1 Aug 2021 17:22:56 +0200 Subject: [PATCH] fix: Do not optimize images when image_resolution < 1 --- src/main/java/w2phtml/base/BinaryGraphicsDocument.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/w2phtml/base/BinaryGraphicsDocument.java b/src/main/java/w2phtml/base/BinaryGraphicsDocument.java index f7386a4..d5e8dec 100644 --- a/src/main/java/w2phtml/base/BinaryGraphicsDocument.java +++ b/src/main/java/w2phtml/base/BinaryGraphicsDocument.java @@ -265,7 +265,7 @@ public class BinaryGraphicsDocument implements OutputFile { float targetPPI = config.getImageResolution(); //int targetQuality = config.getImageQuality(); //float quality = targetQuality / 100; - if (blob == null || style == null || isInvalidImageFormat()) { + if (blob == null || style == null || isInvalidImageFormat() || targetPPI < 1) { return; } extractPPI();