Browse our Products

Aspose.Imaging for JAVA 24.9 - Release notes

Competitive features:

  • Fix EMF to SVG error, extend SVG gradient support
KeySummaryCategory
IMAGINGJAVA-8803Fix EMF to SVG error, extend SVG gradient supportFeature
IMAGINGJAVA-8804Incorrect export from particular EMF to any raster format in memory optimization strategyEnhancement
IMAGINGJAVA-8799Incorrectly closed path on SVG renderEnhancement
IMAGINGJAVA-8798MemoryStream ObjectDisposedException saving TiffEnhancement

Public API changes:

Added APIs:

Please see corresponding cumulative API changes for Aspose.Imaging for .NET 24.9 version

Removed APIs:

Please see corresponding cumulative API changes for Aspose.Imaging for .NET 24.9 version

Usage Examples:

IMAGINGJAVA-8804 Incorrect export from particular EMF to any raster format in memory optimization strategy

try (Image image = Image.load("1.emf", new LoadOptions {{ setBufferSizeHint(200); }}))
{
    image.save("output.png", new PngOptions());
}

try (Image image = Image.load("1.emf", new LoadOptions {{ setBufferSizeHint(200); }}))
{
    image.save("output.jpg", new JpegOptions());
}

try (Image image = Image.load("1.emf", new LoadOptions {{ setBufferSizeHint(200); }}))
{
    image.save("output.bmp", new BmpOptions());
}

IMAGINGJAVA-8803 Fix EMF to SVG error, extend SVG gradient support

String inputPath = "input.emf";
try (Image image = Image.load(inputPath))
{
	image.save(inputPath + ".svg");
}

IMAGINGJAVA-8799 Incorrectly closed path on SVG render

### Example
The sample SVG is exported as an image with an open arc without crossed lines.

String inputFilePath = "svgHalfNotch2.svg";
String outputFilePath = "svgHalfNotch2.svg.png";
try (Image image = Image.load(inputFilePath))
{
	SvgRasterizationOptions rasterizationOptions = new SvgRasterizationOptions()
	{{
		setPageWidth(image.getWidth());
		setPageHeight(image.getHeight());
	}};

	PngOptions pngOptions = new PngOptions();
	pngOptions.setVectorRasterizationOptions(rasterizationOptions);

	image.save(outputFilePath, pngOptions);
}

IMAGINGJAVA-8798 MemoryStream ObjectDisposedException saving Tiff

void tiffTest()
{
    ByteArrayOutputStream ms = new ByteArrayOutputStream();
    saveTiff(ms);

	System.gc();
	System.runFinalization();
	Thread.yield();
	
    // does not throw exception
    System.out.print(ms.size());
}

void saveTiff(ByteArrayOutputStream stream)
{
    TiffOptions tiffOptions = new TiffOptions(TiffExpectedFormat.TiffLzwRgba);
	tiffOptions.setSource(new StreamSource(stream));
    try (Image image = Image.create(tiffOptions, 1000, 1000))
    {
        image.save();
    }

    // does not throw exception
    System.out.print(ms.size());
}

tiffTest();