Option Explicit
Option Base 0
Dim path_f
As String, free_f
As Integer
' Ñèñòåìíûå ïåðåìåííûå
Private ExifTemp()
As Byte
Private Offset_to_IFD0
As Long
Private Offset_to_APP1
As Long
Private Offset_to_TIFF
As Long
Private Length_of_APP1
As Long
Private Offset_to_Next_IFD
As Long
Private IFDDirectory()
As IFD_Data
Private Offset_to_ExifSubIFD
As Long
Private m_Tag
As Long
Private m_file
As String
' Ôîðìàò äàííûõ EXIF
Const m_BYTE = 1
Const m_STRING = 2
Const m_SHORT = 3
Const m_LONG = 4
Const m_RATIONAL = 5
Const m_SBYTE = 6
Const m_UNDEFINED = 7
Const m_SSHORT = 8
Const m_SLONG = 9
Const m_SRATIONAL = 10
Const m_SINGLE = 11
Const m_DOUBLE = 12
' Ôîðìàò òèïîâ äàííûõ EXIF
Private Type IFD_Data_Values
BytVal
As Byte
StrVal
As String
IntVal
As Integer
LngVal
As Long
SngVal
As Single
 
blVal
As Double
End Type
' Ôîðìàò äàííûõ EXIF
Private Type IFD_Data
Tag_No
As Long
MakerNote
As Boolean
 
ata_Format
As Long
Components
As Long
Offset_To_Value
As Long
Value
As Variant
End Type
'Òýãè EXIF
'IFD0 Tags
Const ImageDescription = &H10E&
Const Make = &H10F&
Const Model = &H110&
Const Orientation = &H112&
Const XResolution = &H11A&
Const YResolution = &H11B&
Const ResolutionUnit = &H128&
Const Software = &H131&
Const DateTime = &H132&
Const WhitePoint = &H13E&
Const PrimaryChromaticities = &H13F&
Const YCbCrCoefficients = &H211&
Const YCbCrPositioning = &H213&
Const ReferenceBlackWhite = &H214&
Const Copyright = &H8298&
Const ExifOffset = &H8769&
'ExifSubIFD Tags
Const ExposureTime = &H829A&
Const FNumber = &H829D&
Const ExposureProgram = &H8822&
Const ISOSpeedRatings = &H8827&
Const ExifVersion = &H9000&
Const DateTimeOriginal = &H9003&
Const DateTimeDigitized = &H9004&
Const ComponentsConfiguration = &H9101&
Const CompressedBitsPerPixel = &H9102&
Const ShutterSpeedValue = &H9201&
Const ApertureValue = &H9202&
Const BrightnessValue = &H9203&
Const ExposureBiasValue = &H9204&
Const MaxApertureValue = &H9205&
Const SubjectDistance = &H9206&
Const MeteringMode = &H9207&
Const LightSource = &H9208&
Const Flash = &H9209&
Const FocalLength = &H920A&
Const MakerNote = &H927C&
Const UserComment = &H9286&
Const SubsecTime = &H9290&
Const SubsecTimeOriginal = &H9291&
Const SubsecTimeDigitized = &H9292&
Const FlashPixVersion = &HA000&
Const ColorSpace = &HA001&
Const ExifImageWidth = &HA002&
Const ExifImageHeight = &HA003&
Const RelatedSoundFile = &HA004&
Const ExifInteroperabilityOffset = &HA005&
Const FocalPlaneXResolution = &HA20E&
Const FocalPlaneYResolution = &HA20F&
Const FocalPlaneResolutionUnit = &HA210&
Const ExposureIndex = &HA215&
Const SensingMethod = &HA217&
Const FileSource = &HA300&
Const SceneType = &HA301&
Const CFAPattern = &HA302&
'Interoperability IFD Tags
Const InteroperabilityIndex = &H1&
Const InteroperabilityVersion = &H2&
Const RelatedImageFileFormat = &H1000&
Const RelatedImageWidth = &H1001&
Const RelatedImageLength = &H1002&
'IFD1 Tags
Const ImageWidth = &H100&
Const ImageHeight = &H101&
Const BitsPerSample = &H102&
Const Compression = &H103&
Const PhotometricInterpretation = &H106&
Const StripOffsets = &H111&
Const SamplePerPixel = &H115&
Const RowsPerStrip = &H116&
Const StripByteCounts = &H117&
Const XResolution2 = &H11A&
Const YResolution2 = &H11B&
Const PlanarConfiguration = &H11C&
Const ResolutionUnit2 = &H128&
Const JPEGInterchangeFormat = &H201&
Const JPEGInterchangeFormatLength = &H202&
Const YCbCrCoeffecients = &H211&
Const YCbCrSubSampling = &H212&
Const YCbCrPositioning2 = &H213&
Const ReferenceBlackWhite2 = &H214&
'Misc Tags
Const NewSubfileType = &HFE&
Const SubfileType = &HFF&
Const TransferFunction = &H12D&
Const Artist = &H13B&
Const Predictor = &H13D&
Const TileWidth = &H142&
Const TileLength = &H143&
Const TileOffsets = &H144&
Const TileByteCounts = &H145&
Const SubIFDs = &H14A&
Const JPEGTables = &H15B&
Const CFARepeatPatternDim = &H828D&
Const CFAPattern2 = &H828E&
Const BatteryLevel = &H828F&
Const IPTC_NAA = &H83BB&
Const InterColorProfile = &H8773&
Const SpectralSensitivity = &H8824&
Const GPSInfo = &H8825&
Const OECF = &H8828&
Const Interlace = &H8829&
Const TimeZoneOffset = &H882A&
Const SelfTimerMode = &H882B&
Const FlashEnergy = &H920B&
Const SpatialFrequencyResponse = &H920C&
Const Noise = &H920D&
Const ImageNumber = &H9211&
Const SecurityClassification = &H9212&
Const ImageHistory = &H9213&
Const SubjectLocation = &H9214&
Const ExposureIndex2 = &H9215&
Const TIFFEPStandardID = &H9216&
Const FlashEnergy2 = &HA20B&
Const SpatialFrequencyResponse2 = &HA20C&
Const SubjectLocation2 = &HA214&
Public Function Tag(Path
As String,
Optional ExifTag = &HFFFFFF,
Optional AddDesc =
False)
As Variant
Dim i
As Long
On Error GoTo Skip
BuiltTagTable
' Î÷èñòêà ïåðåìåííûõ
Erase ExifTemp
Erase IFDDirectory
Offset_to_IFD0 = 0
Offset_to_APP1 = 0
Offset_to_TIFF = 0
Length_of_APP1 = 0
Offset_to_Next_IFD = 0
Offset_to_ExifSubIFD = 0
m_Tag = 0
m_file = Path
' Çàãðóçêà ñîäåðæèìîãî ôàéëà â áàéòîâûé ìàññèâ
free_f = FreeFile
Open m_file
For Binary As #free_f
ReDim ExifTemp(LOF(free_f))
As Byte
Get #free_f, , ExifTemp
Close #free_f
' Ïðîâåðêà ïîëó÷åííûõ äàííûõ
If ExifTemp(0) <> &HFF
And ExifTemp(1) <> &HD8
Then
Tag = "ôàéë íå ÷èòàåòñÿ"
GoTo Skip
Else
For i = 2
To UBound(ExifTemp) - 1
If ExifTemp(i) = &HFF
And ExifTemp(i + 1) = &HE1
Then
Offset_to_APP1 = i
Exit For
End If
Next
If Offset_to_APP1 = 0
Then
Tag = "çíà÷åíèå ñòåðòî"
GoTo Skip
End If
Offset_to_TIFF = Offset_to_APP1 + 10
Length_of_APP1 = ExifTemp(Offset_to_APP1 + 2) * 256& + ExifTemp(Offset_to_APP1 + 3)
' Ïðîâåðêà ìàðêèðîâêè EXIF â íà÷àëå ôàéëà
If Chr(ExifTemp(Offset_to_APP1 + 4)) & Chr(ExifTemp(Offset_to_APP1 + 5)) & _
Chr(ExifTemp(Offset_to_APP1 + 6)) & Chr(ExifTemp(Offset_to_APP1 + 7)) <> "Exif"
Then
Tag = "íåïðàâèëüíûé ôîðìàò ôàéëà"
GoTo Skip
End If
End If
If IsIntel
Then
Offset_to_IFD0 = _
ExifTemp(Offset_to_APP1 + 17) * 256& * 256& * 256& + _
ExifTemp(Offset_to_APP1 + 16) * 256& * 256& + _
ExifTemp(Offset_to_APP1 + 15) * 256& + _
ExifTemp(Offset_to_APP1 + 14)
Else
Offset_to_IFD0 = _
ExifTemp(Offset_to_APP1 + 14) * 256& * 256& * 256& + _
ExifTemp(Offset_to_APP1 + 15) * 256& * 256& + _
ExifTemp(Offset_to_APP1 + 16) * 256& + _
ExifTemp(Offset_to_APP1 + 17)
End If
'Debug.Print "Offset_to_IFD0: " & Offset_to_IFD0
GetDirectoryEntries Offset_to_TIFF + Offset_to_IFD0
If ExifTag = 0
Then
On Error Resume Next
Tag =
UBound(IFDDirectory)
On Error GoTo 0
Exit Function
End If
Tag = ""
If ExifTag <> &HFFFFFF
Then
For i = 1
To UBound(IFDDirectory)
If IFDDirectory(i).Tag_No = ExifTag
Then
Tag = IFDDirectory(i).Value
If AddDesc
Then Tag = GetDesc(
CLng(ExifTag)) & ": " & Tag
Exit For
End If
Next i
Else
For i = 1
To UBound(IFDDirectory)
Tag = Tag & GetDesc(IFDDirectory(i).Tag_No) & ": " & CropStr(
CStr(IFDDirectory(i).Value)) & vbCrLf
Next i
End If
Skip:
If Err.Number = 9
Then
Tag = "îøèáêà èííèöèàëèçàöèè"
ElseIf Err.Number <> 0
Then
MsgBox "Îøèáêà ìîäóëÿ Tag: " & Err.Number & ". " & Err.Description
End If
End Function
Private Function IsIntel()
As Boolean
If Hex(ExifTemp(Offset_to_TIFF)) = "49"
Then IsIntel =
True Else IsIntel =
False
End Function
Private Function sPad(sSrc
As String, nSize
As Integer, sPadChar
As String)
As String
If Len(sSrc) < nSize
Then sPad =
String(nSize -
Len(sSrc), sPadChar) & sSrc
Else sPad = sSrc
End Function
Private Sub GetDirectoryEntries(Offset
As Long)
On Error Resume Next
Dim No_of_Entries
As Long
Dim Upper_IFDDirectory
As Long
Dim NewDimensions
As Long
Dim Processed_ExifSubIFD
As Boolean
Dim BytesPerComponent
As Long
Dim Offset_to_MakerNote
As Long
Dim i
As Long, j
As Long
Do
If IsIntel
Then
No_of_Entries = ExifTemp(Offset + 1) * 256& + ExifTemp(Offset + 0)
Else
No_of_Entries = ExifTemp(Offset + 0) * 256& + 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(1
To NewDimensions)
As IFD_Data
For i = 1
To No_of_Entries
With IFDDirectory(Upper_IFDDirectory + i)
If IsIntel
Then
.Tag_No = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 1) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 0)
.Data_Format = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 3) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 2)
.Components = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 7) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 6) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 5) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 4)
Select Case .Data_Format
Case m_BYTE, m_SBYTE
BytesPerComponent = 1
If .Components * BytesPerComponent <= 4
Then
.Value = _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)), 2, "0"
& _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 10)), 2, "0"
& _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 9)), 2, "0"
& _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)), 2, "0"
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
For j = 0
To .Components - 1
.Value = .Value & ExifTemp(Offset_to_TIFF + .Offset_To_Value + j)
Next
End If
Case m_STRING, m_UNDEFINED
BytesPerComponent = 1
If .Components * BytesPerComponent <= 4
Then
.Value = _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)) & _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 10)) & _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 9)) & _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 8))
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
For j = 0
To .Components - 2
.Value = .Value & Chr(ExifTemp(Offset_to_TIFF + .Offset_To_Value + j))
Next
End If
Case m_SHORT, m_SSHORT
BytesPerComponent = 2
If .Components * BytesPerComponent <= 4
Then
.Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
For j = 0
To .Components - 1
.Value = .Value & ExifTemp(Offset_to_TIFF + .Offset_To_Value + j)
Next
End If
Case m_LONG, m_SLONG
BytesPerComponent = 4
If .Components * BytesPerComponent <= 4
Then
.Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
For j = 0
To .Components - 1
.Value = .Value & ExifTemp(Offset_to_TIFF + .Offset_To_Value + j)
Next
End If
Case m_RATIONAL, m_SRATIONAL
BytesPerComponent = 8
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)
.Value = _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 3) * 256& * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 2) * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 1) * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 0) & _
"/" & _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 7) * 256& * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 6) * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 5) * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 4)
End Select
Else
.Tag_No = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 0) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 1)
.Data_Format = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 2) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 3)
.Components = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 4) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 5) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 6) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 7)
Select Case .Data_Format
Case m_BYTE, m_SBYTE
BytesPerComponent = 1
If .Components * BytesPerComponent <= 4
Then
.Value = _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)), 2, "0"
& _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 9)), 2, "0"
& _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 10)), 2, "0"
& _
sPad(Hex(ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)), 2, "0"
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
For j = 0
To .Components - 1
.Value = .Value & ExifTemp(Offset_to_TIFF + .Offset_To_Value + j)
Next
End If
Case m_STRING, m_UNDEFINED
BytesPerComponent = 1
If .Components * BytesPerComponent <= 4
Then
.Value = _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 8)) & _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 9)) & _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 10)) & _
Chr(ExifTemp((Offset + 2) + ((i - 1) * 12) + 11))
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
For j = 0
To .Components - 1
.Value = .Value & Chr(ExifTemp(Offset_to_TIFF + .Offset_To_Value + j))
Next
End If
Case m_SHORT, m_SSHORT
BytesPerComponent = 2
If .Components * BytesPerComponent <= 4
Then
.Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
For j = .Components - 1
To 0
Step -1
.Value = .Value & ExifTemp(Offset_to_TIFF + .Offset_To_Value + j)
Next
End If
Case m_LONG, m_SLONG
BytesPerComponent = 4
If .Components * BytesPerComponent <= 4
Then
.Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
Else
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
For j = 0
To .Components - 1
.Value = .Value & ExifTemp(Offset_to_TIFF + .Offset_To_Value + j)
Next
End If
Case m_RATIONAL, m_SRATIONAL
BytesPerComponent = 8
.Offset_To_Value = _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 8) * 256& * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 9) * 256& * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 10) * 256& + _
ExifTemp((Offset + 2) + ((i - 1) * 12) + 11)
.Value = _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 0) * 256& * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 1) * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 2) * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 3) & _
"/" & _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 4) * 256& * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 5) * 256& * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 6) * 256& + _
ExifTemp(Offset_to_TIFF + .Offset_To_Value + 7)
End Select
End If
If .Tag_No = MakerNote
Then
Offset_to_MakerNote = .Offset_To_Value
End If
If .Tag_No = ExifOffset
Then
Offset_to_ExifSubIFD =
CLng(.Value)
End If
End With
Next
If IsIntel
Then
If Not Processed_ExifSubIFD
Then
Offset_to_Next_IFD = _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 3) * 256& * 256& * 256& + _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 2) * 256& * 256& + _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 1) * 256& + _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 0)
Else
Offset_to_Next_IFD = 0
End If
Else
If Not Processed_ExifSubIFD
Then
Offset_to_Next_IFD = _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 0) * 256& * 256& * 256& + _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 1) * 256& * 256& + _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 2) * 256& + _
ExifTemp(Offset + 2 + (No_of_Entries * 12) + 3)
Else
Offset_to_Next_IFD = 0
End If
End If
If Offset_to_Next_IFD = 0
And Processed_ExifSubIFD =
False Then
Offset_to_Next_IFD = Offset_to_ExifSubIFD
Processed_ExifSubIFD =
True
End If
Offset = Offset_to_TIFF + Offset_to_Next_IFD
Loop While Offset_to_Next_IFD <> 0
Skip:
If Err.Number <> 0
Then MsgBox "Îøèáêà ìîäóëÿ GetDirectoryEntries: " & Err.Number & ". " & Err.Description
End Sub
Function GetDesc(ID
As Long)
As String
Dim i
As Integer
For i = 1
To UBound(TagTable)
If ID = TagTable(i).TagID
Then GetDesc = TagTable(i).TagDesc
DoEvents
Next i
End Function
Function CropStr(InData
As String)
As String
Dim tStr
As String
InData = Trim(InData)
If Len(InData) > 0
Then
If Right(InData, 1) = Chr(0)
Then InData = Left(InData,
Len(InData) - 1)
End If
CropStr = InData
End Function