RE: Accessing Photo Metadata (IPTC specifically)

"photools Support" <[email protected]> Thu, 27 Jan 2005 20:26:54 +0100
Newsgroups gmane.comp.graphics.imatch
Organization photools.com
Message-ID <[email protected]>
Hi,

The IPTC stream class will return the "nothing"  (aka NULL) for IPTC data not in
your images. You need to check for that.

-- Mario


-----Original Message-----
From: digitalbohling [mailto:[email protected]] 
Sent: Mittwoch, 26. Januar 2005 22:17
To: [email protected]
Subject: [imatchuserforum] Accessing Photo Metadata (IPTC specifically)



OK, I didn't expect an answer on my long post--mainly just trying to voice my
thoughts out loud. However, now I'm starting to work on solving my issues. First
up: work on a script to export photo metadata
(IPTC) from IMatch and import into a SQL database. Below is the beginning of
that script, but I'm having problems accessing the IPTC data. I'm sure I'm
missing something obvious, your help would be appreciated.

Code...based on object model and sample scripts:

Option Explicit

Sub Main
    Dim db As Database
	Dim ctgry As Category
	Dim img As Image
	Dim res As IMIPTCResult
	Dim gblStream As New IPTCStream
	Dim tmpString As String

    Set db = Application.ActiveDatabase
    If db Is Nothing Then
    	MsgBox "Please open a database first."
    	Exit Sub
    End If

    For Each ctgry In db.Categories
		If ctgry.Name = "Web" Then
			For Each img In ctgry.Images
				res = gblStream.ReadFile(img.FileName)
				If res = imiptcSuccess Then
					tmpString = gblStream.Fields("Caption")
& vbCrLf 'Craps out here
					tmpString = tmpString &
gblStream.Fields("Headline") & vbCrLf
					tmpString = tmpString &
gblStream.Fields("Copyright") & vbCrLf
					tmpString = tmpString &
gblStream.Fields("Keywords") & vbCrLf
					tmpString = tmpString &
gblStream.Fields("Country") & vbCrLf
					MsgBox tmpString
				End If
			Next
		End If
    Next


End Sub

TIA,
--brandon





 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/imatchuserforum/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/