Re: exif data from jpg's

Tech-Archive recommends: Fix windows errors by optimizing your registry



There is some sample VB6 code here that should work just fine in access

http://www.vbaccelerator.com/home/VB/Code/vbMedia/Using_GDI_Plus/Reading_EXIF_and_Other_Image_Properties/article.asp

I assume you have some code to already read the list of files in a
directory?

Here is some code that will traverse a directory structure, and give you a
"collection" of files;

Sub dirTest()

Dim dlist As New Collection
Dim startDir As String
Dim i As Integer

startDir = "C:\access\"
Call FillDir(startDir, dlist)

MsgBox "there are " & dlist.Count & " in the dir"

' lets printout the stuff into debug window for a test

For i = 1 To dlist.Count
Debug.Print dlist(i)
Next i

End Sub


Sub FillDir(startDir As String, dlist As Collection)

' build up a list of files, and then
' add add to this list, any additinal
' folders

Dim strTemp As String
Dim colFolders As New Collection
Dim vFolderName As Variant

strTemp = Dir(startDir)

Do While strTemp <> ""
dlist.Add startDir & strTemp
strTemp = Dir
Loop

' now build a list of additional folders
strTemp = Dir(startDir & "*.", vbDirectory)

Do While strTemp <> ""
If (strTemp <> ".") And (strTemp <> "..") Then
colFolders.Add strTemp
End If
strTemp = Dir
Loop

' now process each folder (recursion)
For Each vFolderName In colFolders
Call FillDir(startDir & vFolderName & "\", dlist)
Next vFolderName

End Sub

And, for prompting to open a file bowerse dialog:
file open dialog:
http://www.mvps.org/access/api/api0001.htm

browse to folder open dialog:
http://www.mvps.org/access/api/api0001.htm

Between all of the above links, you should be able cobble together some code
in which clicking a button can browses to a folder, then reads in the list
of file names, and then reads the tags (exif) info into a database if you so
need.......

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx


.


Quantcast