Tach auch,
ich möchte mit VB.NET die Exifdaten von Fotos auslesen. Zum Teil geht das reibungslos. Doch bei manchen Eigenschaften bekomme ich die Fehlermeldung:
Was läuft denn hier schief?
Hier der gekürzte Code
ich möchte mit VB.NET die Exifdaten von Fotos auslesen. Zum Teil geht das reibungslos. Doch bei manchen Eigenschaften bekomme ich die Fehlermeldung:
System.ArgumentException: "Die Eigenschaft kann nicht gefunden werden.
Was läuft denn hier schief?
Hier der gekürzte Code
VB.NET-Quellcode
- Sub ExifReadMetadata(StrPfad As String)
- ' ##### Info Exif Tags: https://exiv2.org/tags.html / https://exiftool.org/TagNames/EXIF.html
- Dim Img As Image = Image.FromFile(StrPfad)
- Dim Propitem As PropertyItem
- ' ----- Aufnahme Datum / 306 / Ascii / Exif.Image.DateTime
- Propitem = Img.GetPropertyItem(306) ' 36867
- LblAufnahmedatum.Text = Encoding.ASCII.GetString(Propitem.Value, 0, Propitem.Len - 1)
- ' ----- Hersteller / 271 / Ascii / Exif.Image.Make
- Propitem = Img.GetPropertyItem(271)
- LblHersteller.Text = "Hersteller: " & Encoding.ASCII.GetString(Propitem.Value, 0, Propitem.Len - 1)
- ' ----- Modell / 272 / Ascii / Exif.Image.Model
- Propitem = Img.GetPropertyItem(272)
- LblModell.Text = "Modell " & Encoding.ASCII.GetString(Propitem.Value, 0, Propitem.Len - 1)
- ' ----- Uhrheber / 33432 / Ascii / Exif.Image.Copyright
- Propitem = Img.GetPropertyItem(33432)
- Dim strCopyright As String = Encoding.UTF8.GetString(Propitem.Value, 0, Propitem.Len - 1)
- LblCopyright.Text = "Copyright: " & strCopyright
- ' [ das was funktioniert hier gelöscht ]
- ' ab hier folgende Fehlermeldung "System.ArgumentException: "Die Eigenschaft kann nicht gefunden werden.""
- ' sobald ich das Propitem aktiviere
- '' ----- Auflösung X / 256 / Long / Exif.Image.ImageWidth
- 'Propitem = Img.GetPropertyItem(256)
- 'LblAufloesungX.Text = "Auflösung X: " & (BitConverter.ToInt32(propitem.Value, 0))
- '' ----- Auflösung Y / 257 / Long / Exif.Image.ImageLength
- ' Propitem = Img.GetPropertyItem(257)
- 'LblAufloesungY.Text = "Auflösung Y: " & (BitConverter.ToInt32(propitem.Value, 0))
- ' ----- Bits / 258 / Short / Exif.Image.BitsPerSample
- 'Propitem = Img.GetPropertyItem(258)
- 'LblBits.Text = "Bits: " & (BitConverter.ToInt16(propitem.Value, 0))
- ' ----- Bildsensor / 37399 / Short / Exif.Image.SensingMethod
- 'Propitem = Img.GetPropertyItem(37399)
- 'LblBildsensor.Text = "Bildsensor: " & (BitConverter.ToInt16(Propitem.Value, 0))
- ' ----- GBS / 34853 / Long / Exif.Image.GPSTag
- 'Propitem = Img.GetPropertyItem(34853)
- 'LblGPS.Text = "GPS: " & LngGPS
- End Sub
Mit freundlichen Dinges
Lupus
P.S: bei allen meine Fragen beziehen sich auf das arbeiten mit Visual Studio 2019 auf Win 10/64 bit und MySQL
Lupus
P.S: bei allen meine Fragen beziehen sich auf das arbeiten mit Visual Studio 2019 auf Win 10/64 bit und MySQL