Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to Read Image Tags in VB.NET Using the Description Section

$
0
0

I am trying to extract image tags from the description section of an image using VB.NET. The image tags are stored in the description section:

enter image description here

Tags I saved:

StyleShootsModel=sam001;StyleShootsAspectRatio=2_3;StyleShootsPreset=Jacqueline;StyleShootsProducts=21FKA00012;StyleShootsFraming=CRP;StyleShootsEquipment=StyleShoots Live ();

I've attempted the following sample code:

Public Shared Function GetDMetaTagFromImage(ByVal path As String) As DateTime    Using fs As FileStream = New FileStream(path, FileMode.Open, FileAccess.Read)        Using myImage As Image = Image.FromStream(fs, False, False)            Dim tagsValue As String = ""            Dim tags = myImage.PropertyItems.FirstOrDefault(Function(pi) pi.Id = &H9C9E)            If tags IsNot Nothing Then                tagsValue = Encoding.Unicode.GetString(tags.Value)            End If            Return tagsValue        End Using    End UsingEnd Function

However, the code doesn't seem to work as expected. How to correctly extract the image tags from the description section using VB.NET?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>