Function Openjpgfile (FileName)
Dim Ascii, Lasthex, Currenthex, Sosfound
Dim FSO, File, I
If Not FileName = "" Then
If InStr (1, FileName, ": \") = 0 Then
filename = Server.MapPath (filename)
End If
Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
If FSO. FileExists (FileName) Then
Set File = FSO. OpenTextFile (FileName, ForReading, False, Tristatefalse)
i = 0
While not file.atendofstream and Sosfound = False
Ascii = ASC (File.read (1))
Lasthex = Currenthex
Currenthex = Right ("0" & Hex (ASCII), 2)
If Lasthex & currenthex = "FFDA" or I > 100000 then
Sosfound = True
End If
Exiftemp (i) = Currenthex
i = i + 1
ReDim Preserve exiftemp (i)
Wend
File.close
Set File = Nothing
Else
Response.Write ("File does not exist")
End If
Set FSO = Nothing
End If
End Function
Sub getdirectoryentries (Offset)
Dim no_of_entries
Dim upper_ifddirectory
Dim newdimensions
Dim PROCESSED_EXIFSUBIFD
Dim bytespercomponent
Dim Offset_to_makernote
Dim I, J, K
Todo
If Isintel Then
No_of_entries = _
Hextodec (Exiftemp (Offset + 1)) * 256 + _
Hextodec (exiftemp (Offset + 0))
Else
No_of_entries = _
Hextodec (exiftemp (Offset + 0)) * 256 + _
Hextodec (Exiftemp (Offset + 1))
End If
On Error Resume Next
Upper_ifddirectory = UBound (ifddirectory)
On Error GoTo 0
Newdimensions = upper_ifddirectory + no_of_entries
ReDim Preserve ifddirectory (newdimensions)
For i = 1 to No_of_entries
K = upper_ifddirectory + i-1
Ifddirectory (k) = Array (null,null,null,null,null,null,null)
' With ifddirectory (upper_ifddirectory + i)
If Isintel Then
Ifddirectory (k) (ifd_idx_tag_no) = _
Exiftemp (Offset + 2) + ((i-1) * 1) & _
Exiftemp (Offset + 2) + ((i-1) * 12) + 0)
' Hextodec exiftemp ((Offset + 2) + ((i-1) * 12) + 1) * 256 + _
' Hextodec (exiftemp (Offset + 2) + ((i-1) * 12) + 0)
Ifddirectory (k) (Ifd_idx_data_format) = _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 3) * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 2)
Ifddirectory (k) (ifd_idx_components) = _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 7) * 256 * 256 * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 6) * 256 * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 5) * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 4)
Select case Ifddirectory (k) (Ifd_idx_data_format)
Case M_byte, M_sbyte
Bytespercomponent = 1
If Ifddirectory (k) (ifd_idx_components) * Bytespercomponent <= 4 Then
Ifddirectory (k) (Ifd_idx_value) = _
Exiftemp (Offset + 2) + ((i-1) * one) & _
Exiftemp (Offset + 2) + ((i-1) * +) & _
Exiftemp (Offset + 2) + ((i-1) * 9) & _
Exiftemp (Offset + 2) + ((i-1) * 12) + 8)
Else
Ifddirectory (k) (Ifd_idx_offsettovalue) = _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 11) * 256 * 256 * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 10) * 256 * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 9) * 256 + _
Hextodec (Exiftemp (Offset + 2) + ((i-1) * 12) + 8)
Fo