I need to read "Title tag" and "original date"of pictures.
I installed WIAaut.dll and put Commondialog on form.
:'( I can read all items from the Img.Properties with a loop.

It is difficult to find out how to get only the "Title tag" and "DateTimeOriginal".

Dani AI

Generated

Useful follow-up to : WIA will expose EXIF properties as numeric IDs, but there is no single universal "Title" field. Programs and cameras write different fields, so check several places and decode them correctly.

A practical VB.NET approach (different from the WIA code shown earlier) is to inspect the image's PropertyIdList and try the common title tags in order: EXIF ImageDescription (ID 270), Windows XP "XPTitle" (ID 40091 — stored as UTF-16LE bytes), or Artist (ID 315). Example decoding logic:

Imports System.Drawing
Imports System.Text

Dim title As String = Nothing
Using img As Image = Image.FromFile("C:\Yvonne.jpg")
    Dim ids = img.PropertyIdList
    If ids.Contains(270) Then
        Dim p = img.GetPropertyItem(270)
        title = Encoding.ASCII.GetString(p.Value).TrimEnd(ChrW(0))
    ElseIf ids.Contains(40091) Then
        Dim p = img.GetPropertyItem(40091)
        title = Encoding.Unicode.GetString(p.Value).TrimEnd(ChrW(0))
    ElseIf ids.Contains(315) Then
        Dim p = img.GetPropertyItem(315)
        title = Encoding.ASCII.GetString(p.Value).TrimEnd(ChrW(0))
    End If
End Using

Troubleshooting and tips:

  • Many images have no EXIF title; mobile apps or web uploads often strip metadata. Always code a sensible fallback.
  • XMP/IPTC title can exist instead of EXIF; parse XMP with a proper metadata library rather than hand-parsing bytes.
  • For robust, cross-format extraction use a maintained library or tool such as MetadataExtractor for .NET or ExifTool.
  • For quick reference on how to enumerate and read GDI+ property items see System.Drawing.Image.PropertyIdList and PropertyItem.

This complements 's WIA-based date approach by showing reliable ways to find and decode the various possible "title" locations.

I need to read "Title tag" and "original date"of pictures.
I installed WIAaut.dll and put Commondialog on form.
:'( I can read all items from the Img.Properties with a loop.


SOLUTION:
Set Img = CreateObject("WIA.ImageFile")
Set IP = CreateObject("WIA.ImageProcess")
Set fs = CreateObject("Scripting.FileSystemObject")

Img.LoadFile "C:\Yvonne.jpg"
Set f = fs.GetFile("c:\Yvonne.jpg")

:) If Img.Properties.Exists("36867") Then
MsgBox "Date of original = " & Img.Properties("36867").Value
Else
MsgBox "Datecreated = " & f.DateCreated
End If

I need to read "Title tag" and "original date"of pictures.
I installed WIAaut.dll and put Commondialog on form.
:'( I can read all items from the Img.Properties with a loop.


SOLUTION:
Set Img = CreateObject("WIA.ImageFile")
Set IP = CreateObject("WIA.ImageProcess")
Set fs = CreateObject("Scripting.FileSystemObject")

Img.LoadFile "C:\Yvonne.jpg"
Set f = fs.GetFile("c:\Yvonne.jpg")

:) If Img.Properties.Exists("36867") Then
MsgBox "Date of original = " & Img.Properties("36867").Value
Else
MsgBox "Datecreated = " & f.DateCreated
End If

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.