If FileUpload1.PostedFile.FileName <> "" Then
Dim img As FileUpload = CType(FileUpload1, FileUpload)
Dim imgByte As Byte() = Nothing
If img.HasFile AndAlso Not img.PostedFile Is Nothing Then
Dim File As HttpPostedFile = FileUpload1.PostedFile
imgByte = New Byte(File.ContentLength - 1) {}
File.InputStream.Read(imgByte, 0, File.ContentLength)
End If
Dim imgStream1 As MemoryStream = New MemoryStream(imgByte)
selected_image = New System.Drawing.Bitmap(imgStream1)
property_ids = selected_image.PropertyIdList
For Each Me.scan_property In property_ids
counter = counter + 1
byte_property_id = selected_image.GetPropertyItem(scan_property).Value
prop_type = selected_image.GetPropertyItem(scan_property).Type
If scan_property = 2 Then
degrees = System.BitConverter.ToInt32(byte_property_id, 0) / System.BitConverter.ToInt32(byte_property_id, 4)
minutes = System.BitConverter.ToInt32(byte_property_id, 8) / System.BitConverter.ToInt32(byte_property_id, 12)
seconds = System.BitConverter.ToInt32(byte_property_id, 16) / System.BitConverter.ToInt32(byte_property_id, 20)
lat_dd = degrees + (minutes / 60) + (seconds / 3600)
ElseIf scan_property = 4 Then
degrees = System.BitConverter.ToInt32(byte_property_id, 0) / System.BitConverter.ToInt32(byte_property_id, 4)
minutes = System.BitConverter.ToInt32(byte_property_id, 8) / System.BitConverter.ToInt32(byte_property_id, 12)
seconds = System.BitConverter.ToInt32(byte_property_id, 16) / System.BitConverter.ToInt32(byte_property_id, 20)
long_dd = degrees + (minutes / 60) + (seconds / 3600)
End If
Next scan_property
read latitude, longitude and location from the image
Mukesh