Aspose.Imaging issue with resize SVG image


Hello, Aspose Team !

In my Java code, I try to load images, using Aspose.Imaging library.
For reach better quality of generated document we want to use SVG format of image in logo.
The method should read different type of images,
then resize to box of document and reload to BufferedImage for next processing.
I found example of code in your manual for WMF format and implemented the same for SVG format.
Here is my method:

public BufferedImage readToImage(InputStream stream, float width, float height) {
	try (ByteArrayOutputStream output = new ByteArrayOutputStream()) {
		com.aspose.imaging.Image image = com.aspose.imaging.Image.load(stream);
		image.resize(Math.round(width), Math.round(height));
		if (image != null) {
			com.aspose.imaging.imageoptions.PngOptions options = new com.aspose.imaging.imageoptions.PngOptions();
			if (image.getFileFormat() == com.aspose.imaging.FileFormat.Svg) {
				options.setVectorRasterizationOptions(new com.aspose.imaging.imageoptions.SvgRasterizationOptions() {{
			if (image.getFileFormat() == com.aspose.imaging.FileFormat.Wmf) {
				options.setVectorRasterizationOptions(new com.aspose.imaging.imageoptions.WmfRasterizationOptions() {{
			options.setCompressionLevel(0);, options);
		return ByteArrayInputStream(output.toByteArray()));
	} catch(Exception fail) {
		return null;

I tried that method with Aspose.Imaging 18.11 version, as well with newest 19.4 version of library,
but unsuccessful, because every time I got an Exception as below:

class com.aspose.imaging.internal.Exceptions.NotImplementedException:
The method or operation is not implemented
com.aspose.imaging.fileformats.svg.SvgImage.resize(Unknown Source)
com.aspose.imaging.Image.resize(Unknown Source)

It is throwing on line: image.resize(Math.round(width), Math.round(height));

Our company have a bought license, but first of all I interesting:
Is the problem with .resize() method still exists in library ?
Or I have implemented something wrong ?



I have observe the sample code shared by you and have observed the information provided as well. I request you to please provide the source file reproducing issue on your end that we may verify on our end to help you further.

#3 (31.4 KB)
jUnitTest with clean implementation of using Aspose.Imaging.
An Exception occurred in line:65 when calling .resize() method.



Thank you for sharing the details. I have observed the issue and issue with ID IMAGINGJAVA-1309 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.