GroupDocs.Metadata for Java 20.11 Release Notes

Major Features

There are the following features, enhancements and fixes in this release:

  • Implement the ability to extract text data chunks from PNG images
  • “DXF version is not valid” exception when reading DXF file
  • Exception: Cannot process loading further due to incorrect file format structure
  • Exception: File is incompatible with exporter
  • Loading process freezes on a damaged file
  • Image loading failed

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
METADATANET-3473Implement the ability to extract text data chunks from PNG imagesNew Feature
METADATANET-3286“DXF version is not valid” exception when reading DXF fileBug
METADATANET-3313Exception: Cannot process loading further due to incorrect file format structureBug
METADATANET-3334Exception: File is incompatible with exporterBug
METADATANET-3385Loading process freezes on a damaged fileBug
METADATANET-3476Image loading failedBug

Public API and Backward Incompatible Changes

Implement the ability to extract text data chunks from PNG images

This new feature allows the user to extract chunks of textual data from PNG images

Public API changes

The PngTextChunk class has been added to the com.groupdocs.metadata.core package

The PngCompressedTextChunk class has been added to the com.groupdocs.metadata.core package

The PngInternationalTextChunk class has been added to the com.groupdocs.metadata.core package

The PngPackage class has been added to the com.groupdocs.metadata.core package

The PngCompressionMethod class has been added to the com.groupdocs.metadata.core package

The getPngPackage method has been added to the PngRootPackage class

Use cases

Extract chunks of textual metadata from a PNG image

try (Metadata metadata = new Metadata("D:\\input.png")) {
    PngRootPackage root = metadata.getRootPackageGeneric();
    for (PngTextChunk chunk : root.getPngPackage().getTextChunks()) {
 
        System.out.println(chunk.getKeyword());
        System.out.println(chunk.getText());
 
        if (chunk instanceof PngCompressedTextChunk) {
            PngCompressedTextChunk compressedChunk = (PngCompressedTextChunk) chunk;
            System.out.println(compressedChunk.getCompressionMethod());
        }
 
        if (chunk instanceof PngInternationalTextChunk) {
            PngInternationalTextChunk internationalChunk = (PngInternationalTextChunk) chunk;
            System.out.println(internationalChunk.isCompressed());
            System.out.println(internationalChunk.getLanguage());
            System.out.println(internationalChunk.getTranslatedKeyword());
        }
    }
}