I am trying to read MetaData (i.e. Camera used in a photo) from an image sitting on my website. I know the metadata is in the photo, and I know the web server is transferring it by watching a HexDump of the data after a direct request to the server. Also, when I transfer the photo to my local harddrive, I can read the MetaData with the following code:
Uri uri = new Uri("file://c:\\temp\\testimage.jpg");BitmapDecoder decoder = BitmapDecoder.Create(uri, BitmapCreateOptions.None, BitmapCacheOption.None);
BitmapFrame frame = decoder.Frames[0];
BitmapMetadata m = frame.Metadata as BitmapMetadata;
However, whenever I change the uri to use an HTTP style and pull the image directly from my website without saving it to disk first, the _safehandle Non-Public Member of the BitmapDecoder class goes to Null, and the Metadata property of that same class shows an error message of "SafeHandle cannot be null".
Is there anyway to have the BitmapDecoder class consider an HTTP image request to be a SafeHandle so it will parse the MetaData from the image
Thx.
}Dan

BitmapDecoder Metadata via HTTP URI
RAFIKABDAT
Karlo
No problem. I'll look for my "I found a WPF bug for Microsoft, and all I got was this shirt." T-Shirt in the mail.
:-)
Wayne.C
After typing my previous message, I got to looking at my code, and I am trying to get the metadata from the first frame.
BitmapFrame frame = decoder.Frames[0];
BitmapMetadata m = frame.Metadata as BitmapMetadata;
So I tried to get it off the "top level" as an option you suggested, but unfortunately that has failed as well with the same safehandle being null issue.
guaro
sl333
Jeff Patton
Ok. I'll report this bug then.
Thanks for finding this!
Christopher Lusardi
wazimu