login about faq

I am trying to read XMP from a jpg but with no luck. Running in VS2013, using latest C# x64 chilkat XMP download, .net 4.5,

The image has 5 embedded xmp docs, when I break into line xmp.GetEmbedded(i), doc is always empty. I have verified valid XMP exists in the photo using another XMP viewer.

        var xmp = new Xmp();
        xmp.UnlockComponent("anything for 30-day trial");
        xmp.LoadAppFile(@"c:\_dev\testphotos\june 28 005.JPG");

        var n = xmp.NumEmbedded;

        for (var i =0; i<n; i++)
        {
            var doc = xmp.GetEmbedded(i);
            Debug.WriteLine(doc.Content);
        }

What am I missing?

asked Jan 19 '14 at 15:27

llaakes's gravatar image

llaakes
1111


Thanks. I received your email with the JPG, and I will test it now..

link

answered Jan 20 '14 at 13:45

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

I tested, but did not find any problem. I noticed two things: You're not checking the return value of UnlockComponent or LoadAppFile. Check that these methods return true for success, and if not, then examine the contents of the LastErrorText.

link

answered Jan 20 '14 at 14:27

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

OK found the problem.

I misinterpreted the docs. I was using Chilkat.Xml.Content but should have been using Chilkat.Xml.GetXml().

When I switched it works fine.

link

answered Jan 22 '14 at 10:18

llaakes's gravatar image

llaakes
1111

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×10

Asked: Jan 19 '14 at 15:27

Seen: 1,652 times

Last updated: Jan 22 '14 at 10:18

powered by OSQA