Browse our Products

Aspose.Imaging for JAVA 26.4 - Release notes

Competitive features:

  • Implement partial GDIRendering
KeySummaryCategory
IMAGINGJAVA-9181Implement partial GDIRenderingFeature
IMAGINGJAVA-9189Fix bug on export to Pdf for images without own streamEnhancement
IMAGINGJAVA-9188MemMgr crushes at the moment of its finalizationEnhancement
IMAGINGJAVA-9182CDR to WEBP IndexOutOfRangeExceptionEnhancement
IMAGINGJAVA-9154JPG file colors are incorrectly readEnhancement
IMAGINGJAVA-8551CDR to PDF - Image Loading FailedEnhancement

Public API changes:

Added APIs:

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

Removed APIs:

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

Usage Examples:

IMAGINGJAVA-9189 Fix bug on export to Pdf for images without own stream

PNG to PDF conversion:
try (PngImage image = new PngImage(32, 32, PngColorType.TruecolorWithAlpha))
{
	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
	image.save(outputStream, new PdfOptions());
}

{

IMAGINGJAVA-9188 MemMgr crushes at the moment of its finalization

Process image conversion async:
public static void convertAll(final String[] inputPaths,final String[] outputPaths,final  ImageOptionsBase options)
{
	if (inputPaths.length != outputPaths.length)
	{
		throw new ArgumentException("Input and output length.");
	}

	Semaphore semaphore = new Semaphore(2);

	ExecutorService service = Executors.newFixedThreadPool(inputPaths.length);

	List<Future<?>> list = new ArrayList<>(inputPaths.length);

	for (int i = 0; i < inputPaths.length; i++)
	{
		final int index = i;
		list.add(service.submit(() -> {
			boolean needRelease = false;
			try
			{
				semaphore.acquire();
				needRelease = true;
				convert(inputPaths[index], outputPaths[index], options.deepClone());
			}
			catch (InterruptedException e)
			{
				throw new RuntimeException(e);
			}
			finally
			{
				if (needRelease)
				{
					semaphore.release();
				}
			}
		}));
	}

	list.forEach(it -> {
		try
		{
			it.get();
		}
		catch (InterruptedException | ExecutionException e)
		{
			throw new RuntimeException(e);
		}
	});
}

private static void convert(String inputPath, String outputPath, ImageOptionsBase options)
{
	try (Image image = Image.load(inputPath))
	{
		image.save(outputPath, options);
	}
}

{

IMAGINGJAVA-9182 CDR to WEBP IndexOutOfRangeException

String fileName = "sample.cdr";
try (Image image = Image.load(fileName))
{
	Image[] pages = ((IMultipageImage)image).getPages();
	for (int i = 0; i < pages.length; i++)
	{
		VectorRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
		rasterizationOptions.setPageWidth(pages[i].getWidth());
		rasterizationOptions.setPageHeight(pages[i].getHeight());
		WebPOptions webpOptions = new WebPOptions();
		webpOptions.setLossless(true);
		webpOptions.setVectorRasterizationOptions(rasterizationOptions);

		pages[i].save(fileName + "." + i + ".webp", webpOptions);
	}
}

{

IMAGINGJAVA-9181 Implement partial GDIRendering

try (Image image = Image.load("test.cdr"))
{
	image.save("test.png", new PngOptions(){{
		setVectorRasterizationOptions(new CdrRasterizationOptions() {{
			setPositioning(PositioningTypes.Relative); 
		}}
	}});
}

{

IMAGINGJAVA-9154 JPG file colors are incorrectly read

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

{

IMAGINGJAVA-8551 CDR to PDF - Image Loading Failed

String baseFolder = "D:\\";
String fileName = "2020 BCF Golf Program.cdr";
String inputFilePath = baseFolder + fileName;
String outputFilePath = inputFilePath + ".pdf";
try (Image image = Image.load(inputFilePath))
{
   image.save(outputFilePath);
}

{