GroupDocs.Metadata for .NET 18.10 Release Notes

Major Features

There are the following features and enhancements in this release:

  • Implement the ability to update Lyrics3 tags
  • Remove MetadataUtility obsolete methods
  • Reduce memory consumption of the PNG format
  • Reduce memory consumption of the JPEG2000 format
  • Reduce memory consumption of the BMP, DICOM, DJVU, EMF, WEBP and WMF formats

All Changes

KeySummaryCategory
METADATANET-383Implement the ability to update Lyrics3 tagsNew Feature
METADATANET-1466Remove MetadataUtility obsolete methodsEnhancement
METADATANET-1608Reduce memory consumption of the PNG formatEnhancement
METADATANET-1632Reduce memory consumption of the JPEG2000 formatEnhancement
METADATANET-1633Reduce memory consumption of the BMP, DICOM, DJVU, EMF, WEBP and WMF formatsEnhancement
METADATANET-1045Exception when cleaning/updating metadata of Strict Open XML Presentation (.pptx)Bug

Public API and Backward Incompatible Changes

Implement the ability to update Lyrics3 tags

Description

This new feature allows a user to update Lyrics3v2 metadata in Mp3 files.

Public API changes

A public constructor has been added to the Lyrics3Field class

The Lyrics3v2Properties property has been added to the Mp3Format class

The Mp3Format.Lyrics3v2 property has been marked as obsolete

The UpdateLyrics3v2(Lyrics3Tag) method has been added to the Mp3Format class

Usecases

Update Lyrics3v2 metadata using the shortcut properties.

using (Mp3Format format = new Mp3Format(@"D:\input.mp3"))
{
    format.Lyrics3v2Properties.Album = "test album";
    format.Lyrics3v2Properties.Artist = "test artist";
    format.Lyrics3v2Properties.AdditionalInfo = "test info";
    format.Lyrics3v2Properties.Lyrics = "[00:01] test lyrics";
 
    format.Save(@"D:\output.mp3");
}

Update Lyrics3v2 metadata by replacing the whole field collection.

using (Mp3Format format = new Mp3Format(@"D:\input.mp3"))
{
    Lyrics3Field[] fields = new Lyrics3Field[]
    {
        new Lyrics3Field("EAL", "test album"),
        new Lyrics3Field("EAR", "test artist"),
        new Lyrics3Field("INF", "test info"),
        new Lyrics3Field("LYR", "[00:01] test lyrics"),
    };
    format.Lyrics3v2Properties.Fields = fields;
 
    format.Save(@"D:\output.mp3");
}

Update Lyrics3v2 metadata by replacing the whole tag.

using (Mp3Format format = new Mp3Format(@"D:\input.mp3"))
{
    Lyrics3Tag tag = new Lyrics3Tag();
    tag.Fields = new Lyrics3Field[]
    {
        new Lyrics3Field("EAL", "test album"),
        new Lyrics3Field("EAR", "test artist"),
        new Lyrics3Field("INF", "test info"),
        new Lyrics3Field("LYR", "[00:01] test lyrics"),
    };
    format.UpdateLyrics3v2(tag);
    format.Save(@"D:\output.mp3");
}

Remove MetadataUtility obsolete methods

Description

This enhancement removes some obsolete members of the MetadataUtility class.

Public API changes

The CompareDoc method has been removed form the *MetadataUtility *class

The *ComparePdf *method has been removed form the *MetadataUtility *class

The *ComparePpt *method has been removed form the *MetadataUtility *class

The *CompareXls *method has been removed form the *MetadataUtility *class

Usecases

Please use the ComparisonFacade.CompareDocuments (*ComparisonFacade.compareDocuments *in Java) method instead.

MetadataPropertyCollection diff = ComparisonFacade.CompareDocuments(@"D:\input1.pptx", @"D:\input2.pptx", ComparerSearchType.Difference);
foreach (MetadataProperty property in diff)
{
    Console.WriteLine("Property name: {0}, value: {1}", property.Name, property.Value);
}

Reduce memory consumption of the PNG format

Description

This enhancement allows working with PNG images with less memory consumption.

Public API changes

None.

Usecases

Please note that the PngFormat class implements the IDisposable interface and it’s necessary to call the Dispose() method when you’re done working with its instance.

using (PngFormat format = new PngFormat(@"d:\input.png"))
{
    // Working with metadata
}

If you are loading a PNG file from a stream, it’s up to you to close the stream when the file is not needed anymore.

using (Stream stream = File.Open(@"d:\input.png", FileMode.Open, FileAccess.ReadWrite))
{
    using (PngFormat format = new PngFormat(stream))
    {
        // Working with metadata
    }
    // The stream is still open here
}

The same rule works if you are saving the output file into a stream.

using (Stream stream = File.Open(@"d:\output.png", FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
    using (PngFormat format = new PngFormat(@"d:\input.png"))
    {
        // Working with metadata
 
        format.Save(stream);
    }
    // The stream is still open here
}

Reduce memory consumption of the JPEG2000 format

Description

This enhancement allows working with JPEG2000 images with less memory consumption.

Public API changes

None.

Usecases

Please note that the Jp2Format class implements the IDisposable interface and it’s necessary to call the Dispose() method when you’re done working with its instance.

using (Jp2Format format = new Jp2Format(@"d:\input.jp2"))
{
    // Working with metadata
}

If you are loading a JPEG2000 file from a stream, it’s up to you to close the stream when the file is not needed anymore.

using (Stream stream = File.Open(@"d:\input.jp2", FileMode.Open, FileAccess.ReadWrite))
{
    using (Jp2Format format = new Jp2Format(stream))
    {
        // Working with metadata
    }
    // The stream is still open here
}

The same rule works if you are saving the output file into a stream.

using (Stream stream = File.Open(@"d:\output.jp2", FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
    using (Jp2Format format = new Jp2Format(@"d:\input.jp2"))
    {
        // Working with metadata
 
        format.Save(stream);
    }
    // The stream is still open here
}

Reduce memory consumption of the  BMP, DICOM, DJVU, EMF, WEBP and WMF formats

Description

This enhancement allows working with BMP, DICOM, DJVU, EMF, WEBP and WMF images with less memory consumption

Public API changes

None.

Usecases

Please note that all classes representing the mentioned formats implement the IDisposable interface and it’s necessary to call the Dispose() method when you’re done working with its instance.

using (BmpFormat format = new BmpFormat(@"d:\input.bmp"))
{
    // Working with metadata
}

If you are loading an image file of the appropriate format from a stream, it’s up to you to close the stream when the file is not needed anymore.

using (Stream stream = File.Open(@"d:\input.djvu", FileMode.Open, FileAccess.ReadWrite))
{
    using (DjvuFormat format = new DjvuFormat(stream))
    {
        // Working with metadata
    }
    // The stream is still open here
}

The same rule works if you are saving the output file into a stream.

using (Stream stream = File.Open(@"d:\output.webp", FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
    using (WebPFormat format = new WebPFormat(@"d:\input.webp"))
    {
        // Working with metadata
 
        format.Save(stream);
    }
    // The stream is still open here
}

Exception when cleaning/updating metadata of Strict Open XML Presentation (.pptx)

Description

This enhancement allows cleaning/updating metadata of Strict Open XML Presentation(.pptx) document.

Public API changes

None.

Usecases

Clean metadata of a strict open XML presentation.

using (PptFormat pptFormat = new PptFormat(@"D:\SOXmlPresentation.pptx"))
{
    pptFormat.CleanMetadata();
    pptFormat.Save(@"D:\SOXmlPresentation_output.pptx");
}

Update metadata of a strict open XML presentation.

using (PptFormat pptFormat = new PptFormat(@"D:\SOXmlPresentation.pptx"))
{
    PptMetadata pptMetadata = pptFormat.DocumentProperties;
    pptMetadata.Title = "usman";
    pptFormat.Save(@"D:\SOXmlPresentation_output.pptx");
}