Skip to content

Commit 70f1de6

Browse files
ars18wrwAndrei Stryhelski
authored andcommitted
Specify extension of ImageMagick's difference image
For some reason .webp comparison fails if the extension of diff image is not specified. DEVSIX-5638 (cherry picked from commit e341c6a)
1 parent 1cc3bef commit 70f1de6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io/src/main/java/com/itextpdf/io/util/ImageMagickHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ public boolean runImageMagickImageCompare(String outImageFilePath, String cmpIma
151151
replacementOutFile = FileUtil.createTempCopy(outImageFilePath, TEMP_FILE_PREFIX, null);
152152
replacementCmpFile = FileUtil.createTempCopy(cmpImageFilePath, TEMP_FILE_PREFIX, null);
153153

154-
replacementDiff = FileUtil.createTempFile(TEMP_FILE_PREFIX, null).toString();
154+
// ImageMagick generates difference images in .png format, therefore we can specify it.
155+
// For some reason .webp comparison fails if the extension of diff image is not specified.
156+
replacementDiff = FileUtil.createTempFile(TEMP_FILE_PREFIX, ".png").getAbsolutePath();
155157
String currCompareParams = fuzzValue + " '"
156158
+ replacementOutFile + "' '"
157159
+ replacementCmpFile + "' '"

0 commit comments

Comments
 (0)