Created
August 27, 2014 18:30
-
-
Save phillip-haydon/d5d18517ec923b23e158 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.