Free Support Forum - aspose.com

Aspose.Imaging issue with resize SVG image

@mvm,

I suggest you to please consider using following sample code on your end using latest Aspose.Imaging for Java 19.11.

String[] fileNames = new String[]
        {
                "Logotype.svg",
                "sample_car.svg",
                "rg1024_green_grapes.svg",
                "MidMarkerFigure.svg",
                "embeddedFonts.svg"
        };

PointF[] scales = new PointF[]
        {
                new PointF(0.5f, 0.5f),
                new PointF(1f, 1f),
                new PointF(2f, 2f),
                new PointF(3.5f, 9.2f),
        };

for (String inputFile : fileNames)
{
    for (PointF scale : scales)
    {
        String outputFile = String.format(Locale.ENGLISH, "%s_%2.1f_%2.1f.png", inputFile, scale.getX(), scale.getY());
        Image image = Image.load(inputFile);
        try
        {
            image.resize((int)(image.getWidth() * scale.getX()), (int)(image.getHeight() * scale.getY()));
            image.save(outputFile, new PngOptions());
        }
        finally
        {
            image.close();
        }
    }
}

Yes, this is exactly, what I was talking about ! Great, now this is working as it should be.
Did you implemented that only for SVG or for all type of vector formats (like SVG, EMF, WMF) ?

@mvm,

The approach that we have shared applies to SVG as this is what has been requested in associated ticket.