{"id":211,"date":"2009-07-10T10:35:08","date_gmt":"2009-07-10T08:35:08","guid":{"rendered":"http:\/\/dev.flauschig.ch\/wordpress\/?p=211"},"modified":"2009-07-10T10:44:13","modified_gmt":"2009-07-10T08:44:13","slug":"get-additional-image-metadata","status":"publish","type":"post","link":"http:\/\/dev.flauschig.ch\/wordpress\/?p=211","title":{"rendered":"Get additional Image Metadata"},"content":{"rendered":"<p>An Image can contain additional Information about the Camera or the Date it was taken. It&#8217;s quite easy to access those Information with C-Sharp. All you need to do is to add a Reference to <code>PresentationCore<\/code> and <code>WindowsBase<\/code>, include the <code>System.Windows.Media.Imaging<\/code> Namespace and use the following Code-Snippet as a StartingPoint:<\/p>\n<pre class=\"brush: csharp; gutter: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\npublic DateTime GetDateTaken(string filePath)\r\n{\r\n    using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))\r\n    {\r\n        BitmapFrame bitmapFrame = BitmapFrame.Create(fileStream, BitmapCreateOptions.DelayCreation, BitmapCacheOption.None);\r\n        BitmapMetadata bitmapMetadata = bitmapFrame.Metadata as BitmapMetadata;\r\n        return DateTime.Parse(bitmapMetadata.DateTaken);\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>An Image can contain additional Information about the Camera or the Date it was taken. It&#8217;s quite easy to access those Information with C-Sharp. All you need to do is to add a Reference to PresentationCore and WindowsBase, include the System.Windows.Media.Imaging Namespace and use the following Code-Snippet as a StartingPoint: public DateTime GetDateTaken(string filePath) { &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4,3],"tags":[78,79,80,82,81],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-roemer","4":"post-211","6":"format-standard","7":"category-csharp","8":"category-programming","9":"post_tag-bitmapframe","10":"post_tag-bitmapmetadata","11":"post_tag-datetaken","12":"post_tag-image","13":"post_tag-metadata"},"acf":[],"views":2411,"_links":{"self":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/211"}],"collection":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=211"}],"version-history":[{"count":0,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/211\/revisions"}],"wp:attachment":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}