Extracting XMP Metadata of an image to a XML File

Example requests & Code samples for GdPicture Toolkits.
Post Reply
User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Extracting XMP Metadata of an image to a XML File

Post by Loïc » Tue Oct 20, 2009 6:17 pm

Here a quick sample to extract XMP Metadata of an image to a file.
In future version of GdPicture.NET we will include an XMP annotation parser.

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Imaging1 As New GdPicture.GdPictureImaging
        Call Imaging1.SetLicenseNumber("XXX") 'Please, replace XXXX by a valid demo or commercial license key.
        'Go to http://evaluation-gdpicture.com to get a 1 month trial key unlocking all features of the toolkit.

        Dim ImageID As Integer = Imaging1.CreateGdPictureImageFromFile("c:\test.tif")

        For i As Integer = 1 To Imaging1.TagCount(ImageID)
            If Imaging1.TagGetID(ImageID, i) = Tags.TagXMLPackets Then
                Dim arByte(0) As Byte
                Dim FileNumber As Integer = FreeFile()

                Imaging1.TagGetValueBytes(ImageID, i, arByte)
                FileOpen(FileNumber, "c:\data.xmp", OpenMode.Binary)
                FilePut(FileNumber, arByte)
                FileClose(FileNumber)
            End If
        Next i

        Imaging1.ReleaseGdPictureImage(ImageID)
    End Sub

Gabriela
Posts: 47
Joined: Wed Nov 22, 2017 9:52 am

Re: Extracting XMP Metadata of an image to a XML File

Post by Gabriela » Fri May 25, 2018 10:31 am

Here is the promised method from GdPicture14 that does the same in one call:
http://guides.gdpicture.com/content/web ... acket.html

You can set metadata using these methods as well:
http://guides.gdpicture.com/content/web ... acket.html
Kind regards,

Gabriela
GdPicture Team

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests