is there anyone could help me to this problem, I have downloaded a module file which is (exifReader), then I apply it to my system code. when I browse an image from a folder or file when I click the a button to show the properties of the image and put it to some textbox, I got this error saying " run time error 9 , Subcription out range",
this is the code for showing the properties of the image :
Expand|Select|Wrap|Line Numbers
- Private Sub Command1_Click()
- If Picture1.Picture = 0 Then
- MsgBox ("Insert Image First")
- Else
- Text6.Text = CommonDialog1.FileName
- Text3.Enabled = False
- Dim objexif As New ExifReader
- objexif.Load (Text6.Text)
- Text2.Text = objexif.Tag(GPSLongitude)
- Text3.Text = objexif.Tag(GPSLatitude)
- Text4.Text = objexif.Tag(GPSInfo)
- Text5.Text = objexif.Tag(DateTimeOriginal)
- Text2.Enabled = False
- Text6.Enabled = False
- Text3.Enabled = False
- End If
- End Sub
- //*******
- and this the module part of code where the error shows.
- Private Function InspectJPGFile() As Boolean
- Dim i As Long
- If ExifTemp(0) <> &HFF And ExifTemp(1) <> &HD8 Then
- InspectJPGFile = False
- Else
- ///this line is having error, subscription out of range///
- 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
- InspectJPGFile = False
- End If
- Offset_to_TIFF = Offset_to_APP1 + 10
- Length_of_APP1 = _
- ExifTemp(Offset_to_APP1 + 2) * 256& + _
- ExifTemp(Offset_to_APP1 + 3)
- 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
- InspectJPGFile = False
- Exit Function
- End If
- InspectJPGFile = True
- End If
if the codes are not enough to analyze please tell me and I post all the code for exifreader class module, any idea and help are really appreciated. thanks..
by the way I use Visual basic 6.0.. ^_^