admin管理员组

文章数量:1122826

For years I've been reading Exif data from Images using the following code to get the individual ExifTags but recently my code has stopped working

Has anyone experienced the same issue using VB and knows of a solution.

Many thanks for your help

Jim

Imports System.Drawing.Imaging Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    Dim sImg As String = "c:\temp\SomeImage.jpg"
    Dim img As Bitmap = Bitmap.FromFile(sImg)
    Dim sMsg As String = "Property Items: " & img.PropertyItems.Count & vbCrLf

    For Each pi As PropertyItem In img.PropertyItems
        sMsg += "Property Id: " & pi.Id & vbCrLf
    Next

    MsgBox(sMsg)

End Sub

End Class

Until about a month ago this would display numerous ExifTags from which I could obtain their individual properties. Recently performing this operation no yields only 2 tags as follows for any image I've tried.

Property Items: 2 Property ID: 20625 Property ID: 20624

I've tried images from several different cameras - each showing the same 2 property items - rather than the full list. I know that the ExifTags exist in the image because I can read them using other tools, such as ExifTools or ExifLib

本文标签: propertiesReading EXIF Data (Image MetaData) FailsStack Overflow