3.5k Aufrufe
Gefragt in Datenbanken von
Hallo an alle,

nur mal so eine Frage.
Kann man mit Access (bei mir Access 2000) auch die EXIF-Daten eines jpg-Bildes auslesen?
Wenn ja, in welchem Umfang?
(Datum Uhrzeit des Fotos, Hoch- oder Querformat usw.)

Danke !

Gruß
spaceman

2 Antworten

0 Punkte
Beantwortet von marie Experte (2k Punkte)
breite und Höhe hab ich gefunden:
Option Explicit

Public Sub Datei_Auswahl()
Dim strDatei As String
Dim strDummy As String
Dim ff As Integer
Dim c As Integer
Dim S As String
Dim L As Long
Dim JPGWidth As Long
Dim JPGHeight As Long

With Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = "C:\"
.Title = "Dateiauswahl"
.ButtonName = "Auswahl..."
.Filters.Add "JPG-Dateien", "*.jpg; *.jpeg", 1
.InitialView = msoFileDialogViewList
If .Show = -1 Then
strDatei = .SelectedItems(1)
Else
MsgBox "Es wurde keine Datei ausgewaehlt!"
Exit Sub
End If
End With

ff = FreeFile()

Open strDatei For Binary Access Read As #ff

If Input(2, #ff) <> (Chr$(&HFF) & Chr$(&HD8)) Then
Close #ff
Exit Sub
End If

strDummy = Input(2, #ff)

Do
L = Asc(Input(1, #ff))
L = L * 256 + Asc(Input(1, #ff))
S = Input(L - 2, #ff)

If c = &HC0 Or c = &HC2 Then
JPGWidth = Asc(Mid$(S, 4, 1))
JPGWidth = JPGWidth * 256 + Asc(Mid$(S, 5, 1))
JPGHeight = Asc(Mid$(S, 2, 1))
JPGHeight = JPGHeight * 256 + Asc(Mid$(S, 3, 1))
End If

If Input(1, #ff) <> Chr$(255) Then
Exit Do
End If

c = Asc(Input(1, #ff))
Loop While c <> &HD9

Close #ff

MsgBox "Die Grafik " & strDatei & " ist " & vbNewLine & _
CStr(JPGWidth) & " Pixel breit und " & vbNewLine & _
CStr(JPGHeight) & " Pixel hoch.", _
vbInformation, "JPG-Analyse"

End Sub


Aber schau mal ob Dir das was hilft:
www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=48209&lngWId=1

Gruß marie
0 Punkte
Beantwortet von
Hallo marie,

danke für deine Antwort. Dachte schon es kommt nichts mehr.

Habe in den letzten Tage auch noch mal weitergesucht und bei
www.g-st.ch/privat/freeware/jpeginfo.html was gefunden. Das ist zwar eine komplette Datenbank, aber die Kriterien die ich hauptsächlich gesucht habe, habe ich da im Quellcode gefunden.
Werde mir aber auch deinen Vorschlag ansehen.
Also vielen Dank.

Gruß
spaceman
...