Imports System.Drawing.Imaging Imports System.BitConverter Public Structure EXIFDataStruct Public Kameramodell As String Public Belichtungszeit As String Public Blende As String Public ISO As String Public Brennweite As String Public Auflösung As String End Structure Public Class EXIFData Private Enum EXIFPropertyName As Integer Kameramodell = 272 Belichtungszeit = 33434 Blende = 33437 ISO = 34855 Brennweite = 37386 XAuflösung = 40962 YAuflösung = 40963 End Enum Public Shared Function GetEXIFData(ByRef img As Image) As EXIFDataStruct Dim exifResult As EXIFDataStruct = Nothing SetDefaults(exifResult) Dim props() As PropertyItem = img.PropertyItems For Each propItem As PropertyItem In props Select Case propItem.Id Case EXIFPropertyName.Kameramodell exifResult.Kameramodell = _ System.Text.Encoding.ASCII.GetString(propItem.Value) Case EXIFPropertyName.Belichtungszeit Dim iFirstPart As UInt32 = ToUInt32(propItem.Value, 0) Dim iSecondPart As UInt32 = ToUInt32(propItem.Value, 4) If (iFirstPart = iSecondPart) Then exifResult.Belichtungszeit = _ iSecondPart.ToString("0") + " sec" Else exifResult.Belichtungszeit = _ iFirstPart.ToString("0") + "/" + _ iSecondPart.ToString("0") + " sec" End If Case EXIFPropertyName.Blende Dim fNumber As Single = ToSingle(propItem.Value, 0) / _ ToSingle(propItem.Value, 4) exifResult.Blende = "F " + fNumber.ToString("0.0") Case EXIFPropertyName.ISO exifResult.ISO = ToUInt16(propItem.Value, 0).ToString() Case EXIFPropertyName.Brennweite Dim focLen As UInt16 = ToUInt16(propItem.Value, 0) exifResult.Brennweite = focLen.ToString() + " mm"