Function ReadExifDate(var sDate:string; FileName : String) : Boolean;<br>Const<br> Numbers9 : Set of Char = ['0'..'9'];<br> Numbers1 : Set of Char = ['0'..'1'];<br> Numbers3 : Set of Char = ['0'..'3'];<br> Numbers5 : Set of Char = ['0'..'5'];<br> MaxItems = $9FF; <br>Var<br> f : File of Char;<br> s : String;<br> i,j : Integer;<br> a : Array[0..MaxItems] of Char;<br>Begin<br> Result := False; <br> sDate := ''; <br> s := ''; <br> AssignFile(f, Filename);<br> Filemode := 0; <br> Reset(f);<br> For I := 0 to MaxItems do Begin<br> If not Eof(f) then<br> Read(f,a); <br> End;<br> CloseFile(f);<br><br> s := a[6] + a[7] + a[ 8 ] + a[9]; <br> If ANSIUppercase(s) = 'EXIF' then <br> Result := True<br> else<br> Exit; <br> For I := 10 to MaxItems - 15 do Begin<br> If a = ':' then Begin<br> s := '';<br> For j := 0 to 18 do<br> s := s + a[i + j - 4]; <br> If <br> (s[01] in Numbers9) and (s[02] in Numbers9) and<br> (s[03] in Numbers9) and (s[04] in Numbers9) and<br> (s[05] = ':') and<br> (s[06] in Numbers1) and (s[07] in Numbers9) and<br> (s[08] = ':') and<br> (s[09] in Numbers3) and (s[10] in Numbers9) and<br> (s[11] = ' ') and<br> (s[12] in Numbers5) and (s[13] in Numbers9) and<br> (s[14] = ':') and<br> (s[15] in Numbers5) and (s[16] in Numbers9) and<br> (s[17] = ':') and<br> (s[18] in Numbers5) and (s[19] in Numbers9) then Begin<br> sDate := s;<br> If sDate = '0000:00:00 00:00:00' then<br> ShowMessage('Illegal datetime found!');<br> Exit; <br> End;<br> End;<br> End;<br>End;