-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclsInputFileImage.vb
92 lines (63 loc) · 2.49 KB
/
clsInputFileImage.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Imports System.IO
Imports Microsoft.VisualBasic.FileIO
Imports System.Drawing.Imaging
Public Class clsInputFileImage
Inherits clsInputFile
Dim bmp As Bitmap = Nothing
Public Sub New(ByVal strFile As String)
FilePath = strFile
'Read the image file
Try
bmp = New Bitmap(strFile)
Catch ex As Exception
ErrorMessage = "Couldn't load image file ' " & strFile & "'. Error message was: " & ex.Message
End Try
End Sub
Public Overrides Function GetPotentialRecords() As DataTable
Dim dt As DataTable = GetEmptyRecordsDatatable()
Dim row As DataRow
'EXIF properties
If Not bmp Is Nothing Then
Dim exif As clsExifWorks = New clsExifWorks(bmp)
row = dt.NewRow()
Dim dblLon As Double = exif.Longitude
Dim dblLat As Double = exif.Latitude
'Debug.Print("longitude is: " & dblLon)
If Not dblLon = Nothing Then
row("FileLon") = dblLon
row("FileLat") = dblLat
End If
row("Filename") = Path.GetFileName(FilePath)
'row("FileIndex")
'Date & time - asuume in local time, so don't convert from UTC
If Not exif.DateTimeOriginal = DateTime.MinValue Then
row("RecDate") = exif.DateTimeOriginal.ToString("dd/MM/yyyy")
row("RecTime") = exif.DateTimeOriginal.ToString("H:mm")
row("DateTimeKey") = exif.DateTimeOriginal.ToString("yyMMddHmmss")
End If
row("MediaFile") = FilePath
dt.Rows.Add(row)
End If
Return dt
End Function
Public Overrides Function GetTracks() As DataTable()
Dim dt(0) As DataTable
Return dt
End Function
Public Overrides Function LocationFromTime(ByVal dtetim As Date) As DataTable
Dim dt As DataTable = New DataTable
Return dt
End Function
Public Overrides Function TimeFromLocation(ByVal lat As Double, ByVal lon As Double) As DataTable
Dim dt As DataTable = New DataTable
Return dt
End Function
Public Overrides Function TrackToPoint(ByVal ref As String, ByVal dte As String, ByVal time As String, ByVal intPoints As Integer) As DataTable
Dim dt As DataTable = New DataTable
Return dt
End Function
Public Overrides Function AllTrackPoints() As DataTable
Dim dt As DataTable = New DataTable
Return dt
End Function
End Class