Omnipresent
Omnipresent

Reputation: 30424

How to embed xmp xml metadata to PNG

I am using the commons io imaging library. On the format page the library says

Can read XMP XML (as as String) from TIFF, GIF, PNG, JPEG and PSD. Can embed XMP XML when writing GIF, PNG and TIFF. Can remove, insert and update XMP XML into existing JPEG files.

However, I can't find any example of how to embed xmp xml to a PNG image. I've been able to update xmp xml of a JPEG with the code below but not sure how to do it for PNG

        String xmpXml = "<x:xmpmeta>" +
        "\n<sample>" +
        "\n\t<Date>"+"some date"+"</Date>" +
        "\n\t<Description>"+"Some description"+"</Description>" +
        "\n</sample>" +
        "\n</x:xmpmeta>";
      JpegXmpRewriter rewriter = new JpegXmpRewriter();
      rewriter.updateXmpXml(isNew1,os, xmpXml);

Upvotes: 2

Views: 889

Answers (0)

Related Questions