Hi,
We found that some wmf files can’t be loaded at all.
The version is ‘com.aspose:aspose-imaging:22.10:jdk16’
Actually we can load many other wmf files successfully, but there around 100 wmf files that can’t loaded.
The sample code is below.
import java.io.File;
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.wmf.WmfImage;
public class TestWmf {
public static void main(String[] args) throws Exception {
File wmfFile = new File("src/main/resources/wmf/test.wmf");
boolean canLoad = Image.canLoad(wmfFile.getAbsolutePath());
System.out.println("canLoad: " + canLoad); // it says true.
WmfImage wmfImage = (WmfImage) Image.load(wmfFile.getAbsolutePath()); //stuck here forever.
try {
System.out.println("Loaded wmf successfully.");
} finally {
wmfImage.dispose();
}
}
}
Test data: bad-wmfs.zip (515.7 KB)
And all of the test data can be rendered in https://www.photopea.com/ successfully.
It seems that there is an infinite loop somewhere in aspose.imaging wmf code.
We may raise this ticket as high level as it seems that the fundamental feature is broken.
Could you help to check it? thanks
Regards,
Tony