Skip to content

Instantly share code, notes, and snippets.

@phillip-haydon
Created August 27, 2014 18:30
Show Gist options
  • Save phillip-haydon/d5d18517ec923b23e158 to your computer and use it in GitHub Desktop.
Save phillip-haydon/d5d18517ec923b23e158 to your computer and use it in GitHub Desktop.
using (var exifStream = new MemoryStream())
using (var imageFactory = new ImageFactory())
{
file.Value.Position = 0;
file.Value.CopyTo(exifStream);
exifStream.Position = 0;
var exifData = imageFactory.Load(exifStream)
.GetExifTags();
foreach (var tag in exifData)
{
photo.AddImageProperties(tag.Name, tag.Value, tag.RawValue);
}
}
@phillip-haydon
Copy link
Author

OH, I'm using NancyFX so am currently running this stuff when the file is uploaded.

So file happens to be the file uploaded, but I have to copy it into a MemoryStream to pass into ImageFactory.

Also I saved the raw file prior to this which is why i reset the stream. It's just fluff code.


So you want to be able to set value as well as get them? Right now I'm only focusing on getting the values out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment