Aspose.Imaging for JAVA 22.6 - Release notes

Competitive features:

  • Fix issue with rounded corners in rectangle generated in emf file
Key Summary Category
IMAGINGJAVA-8131 Fix issue with rounded corners in rectangle generated in emf file Feature
IMAGINGJAVA-8152 Cannot load particular ODG image Enhancement
IMAGINGJAVA-8151 Can’t load DCM image Enhancement
IMAGINGJAVA-8141 Fix bug with exception in CDR file Enhancement
IMAGINGJAVA-8134 Can’t load DCM image Enhancement
IMAGINGJAVA-8129 Cannot read DICOM image Enhancement
IMAGINGJAVA-8124 AdjustContrast and AdjustGamma operations are not properly applies on Gif multiframe image Enhancement

Public API changes:

Added APIs:

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

Removed APIs:

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

Usage Examples:

IMAGINGJAVA-8152 Cannot load particular ODG image

try (Image img = Image.load("PasswordProtect.odg", new OdLoadOptions() {{ setPassword("123456789"); }}))
{
    img.save("PasswordProtect.odg.png", new PngOptions());
}

IMAGINGJAVA-8151 Can’t load DCM image

Now provided DICOM sample can be loaded and export to raster format, for example PNG format:

try (Image image = Image.load("file.dcm"))
{
    image.save("file-to-png.png", new PngOptions());
}

IMAGINGJAVA-8141 Fix bug with exception in CDR file

String fileName = "file.cdr";
String outFileName = fileName + ".png";
try (Image image = Image.load(fileName))
{
    image.save(outFileName, new PngOptions());
}

IMAGINGJAVA-8134 Can’t load DCM image

try (Image image = Image.load("file.dcm"))
{
    image.save("file-png.png", new PngOptions());
}

IMAGINGJAVA-8131 Rounded corners in rectangle generated in emf file

String baseFolder = "D:\\";
String file = "result.png";
String outputFileName = baseFolder + file;
EmfRecorderGraphics2D graphics = new EmfRecorderGraphics2D(
    new Rectangle(0, 0, 1000, 1000),
    new Size(1000, 1000),
    new Size(100, 100));

Pen pen = new Pen(Color.getRed(), 10);
graphics.drawRectangle(pen, 10, 10, 80, 80);
pen.setLineJoin(LineJoin.Miter);
pen.setEndCap(LineCap.Flat);

try (EmfImage image = graphics.endRecording())
{
    image.save(outputFileName, new PngOptions());
}

IMAGINGJAVA-8129 Cannot read DICOM image

try (DicomImage image = (DicomImage) Image.load("file.dcm"))
{
    PngOptions pngOptions = new PngOptions();
	pngOptions.setColorType(PngColorType.TruecolorWithAlpha);
	pngOptions.setProgressive(true);

    image.save("file-page-0.png", pngOptions);
    image.getPages()[57].save("file-page-57.png", pngOptions);
}

IMAGINGJAVA-8124 AdjustContrast and AdjustGamma operations are not properly applies on Gif multiframe image

String path = "earth.gif";

String outputPath = "earth-contrast.gif";
try (RasterImage image = (RasterImage) Image.load(path))
{
    image.adjustContrast(40);
    image.save(outputPath);
}

outputPath = "earth-gamma.gif";
try (RasterImage image = (RasterImage) Image.load(path))
{
    image.adjustGamma(3.5f);
    image.save(outputPath);
}