Welcome Guest Search | Active Topics | Members | Log In | Register
Extracting XMP data Options
compugraph
Posted: Tuesday, October 07, 2008 12:25:23 PM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
Roger,

I'm trying to get some XMP data out of the media assets using System.Windows.Media.Imaging.BitmapMetadata (and of course the WpfMetadataExtractor).

As I understod 'til now you're getting the WIC data out by using the policy component query strings (e.g. bmpMetadata.Policystring).

The thing I try to code is using the complete representation like

"/ifd/{ushort=700}/http\\:\\/\\/ns.adobe.com\\/lightroom\\/1.0\\/:hierarchicalSubject/{ulong=0}"

which gives you the hierarchical Lightroom XMP metadata categories (and everything else if you got the right query) not using PolicyStrings but using the the GetQuery Method.

GetQuery returns and object (containing mostly strings or string arrays).

How (and where) can I use that (tried to put it in WpfMEtadataExtractor) in order to get that data back to IGalleryMetadataItemCollection. Actually I dont' have any numeric representation of the XMP-data (you are using to identify the metadata-type)?

Ralf
Roger Martin
Posted: Tuesday, October 07, 2008 1:02:05 PM
Rank: Administration

Joined: 8/3/2007
Posts: 847
Location: Fort Atkinson, WI
I am not quite sure I understand your issue. For starters, I don't know anything about "policystring". That does not appear anywhere in my code.

As you probably have seen in WpfMetadataExtractor, a metadata item is added to the collection like this:

Code:
metadataItems.AddNew(int.MinValue, FormattedMetadataItemName.Title, Resources.Metadata_Title, bmpMetadata.Title, true);


That method has this signature:

Code:
IGalleryObjectMetadataItem AddNew(int mediaObjectMetadataId, GalleryServerPro.Business.Metadata.FormattedMetadataItemName metadataItemName, string description, string value, bool hasChanges);


Basically, you are just adding two strings - the description and value. These are what appear in the two columns of the image metadata popup window. I assume you are able to get this info using your GetQuery technique.

So the only mystery is what do you use for the FormattedMetadataItemName? For that, I suggest adding items to this enum to match what you are adding. For example, if you want to add a metadata item named GPS coordinates, add an enum value GpsCoordinate to the enumeration.

If this didn't answer your question, let me know.


Roger Martin
Lead Developer for Gallery Server Pro
compugraph
Posted: Wednesday, October 08, 2008 10:00:07 AM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
Roger,

got it,
and it shows up to work....

the policies are simply the bmpmetadata.Author (.Title, .Description) "short" forms of the appropriate full query like bmpmetadata.getQuery("/app1......") allowing to get full metadata access, returning an object.

See Robert A. Wlodarcyk's Blog

All I have to do now is to cast the object to a formatted string, thus being able to use some more functionality like gathering hierarchical Subjects (Adobe Lightroom) user defined XMP-data (from other Adobe product like Photoshop, Bridge....) and translations (by parsing user defined language tags).

Once again, thank you for your immediate help. I'm confident to get the functionality up and running 'til end of week and would be glad to help someone with the sometimes complicated XMP structure.

Ralf.
compugraph
Posted: Monday, October 13, 2008 2:38:12 PM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
Roger,

seemed to run well (in the process of my UI-app),

but since WPF components throw com.Exceptions when running outside a thread that doesn't have its apartment state set to STA, and I don't know how to manage that), I'm not able to get those data out of those images.

e.g.: while walking through the metadata items after a specific point (mostly the /xmp tags) I get the "System.Runtime.InteropServices.COMException’ occurred in PresentationCore.dl".
running the same code in my Windows.Form app I get all metadata (as expected).

thx to
Aaron and Sebastian

I could narrow it a bit, but don't know how to continue....

Maybe you could help me to get the extraction done in a separate thread (don't know if that'll help).

Next thing I'll try is to use the raw file I/O, formatting it (using System.XML) and crawling the XML-nodes.


Ralf.
Roger Martin
Posted: Monday, October 13, 2008 2:51:29 PM
Rank: Administration

Joined: 8/3/2007
Posts: 847
Location: Fort Atkinson, WI
Ralf, unfortunately I don't have a whole lot of experience in dealing with threads, so I would have to look it up, and I really need to stay focused on my regular GSP development. Maybe you could try posting at www.asp.net...


Roger Martin
Lead Developer for Gallery Server Pro
compugraph
Posted: Monday, October 13, 2008 7:54:16 PM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
Roger,
np, I switched over to File/IO -> XML and it works as expected. I'll get back to the Wpf way if MS fixes it (as already announced in a newsgroup).

Ralf.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.2 (NET v2.0) - 9/27/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.