You are viewing limited content. For full access, please sign in.

Question

Question

Can we extract GeoTag information from pictures in Laserfiche repository and insert it into a Field?

asked on March 11, 2015 Show version history

Hi

The client has pictures in the repository that contains GeoTag (or Geolocation) information in properties of these picture, we want to extract these information from the picture details and upload them into a data base.

 

Is there a way to do this?     I am wondering if this can be done via the use of SDK?  

 

Note that these picture are sent into repository by Laserfiche Forms, the ideas would be to capture GeoTag information during form submission.  

 

Any suggestion is appreciated....

 

Thanks

 

0 0

Replies

replied on March 12, 2015

The GeoTag (EXIF) data can be extracted using the "System.Drawing.Image.GetPropertyItem(propertyItem).Value" method.

Here is a list of propertyitem values you can use to get various EXIF values:
http://msdn.microsoft.com/en-us/library/ms534416%28VS.85%29.aspx

2 0
replied on March 12, 2015

Hi Bert

 

I though this would be an SDK solution, I am getting our developer involved on this.  I see that the EXIF information only show Latitude and Altitude co-ordinance, how could we translate that to street address?

0 0
replied on March 12, 2015

See the Code Project article Google Geocoding and Reverse Geocoding for information on how to get the street address from GPS coordinates using the google API.

2 0
replied on March 12, 2015

Hi Farzali,

 

In the configuration of the Laserfiche mobile there is a check box to add a field for geotag information.

Guess this will help going forward but I'm not sure about how to extract the location information out of the existing picture files. I found this

https://answers.yahoo.com/question/index?qid=20100813144226AAERS2s 

so it looks like there are applications out there that can do it. Guess it would have to be referenced somehow through a script or something (I'm not a developer so need someone with code knowledge to fill in the blanks). On the face of it, it certainly looks possible.

 

Hope this helps for now! yes

0 0
replied on March 12, 2015

Hi Chris   

For this is not Laserfiche mobile, here we have developed a Laserfiche Forms for the activity and forms does not have any GeoTag field that can be enabled.  If there is I am not aware of it, is Geotag >>>Add a field for geotag information available in Forms configuration?

0 0
replied on March 12, 2015

Here is code that shows how to get a list of all metadata from an image:

    Private Function ImageMetaData(ByVal sImagePath As String) As List(Of String)
        Dim lsReturn As New List(Of String)
        Try
            If Not String.IsNullOrEmpty(sImagePath) Then
                Dim myImageInfo As New System.IO.FileInfo(sImagePath)
                If myImageInfo.Exists Then
                    Dim lsImageExtentions As List(Of String) = New List(Of String) From {".tif", ".tiff", ".jpg", ".jpeg", ".png", ".exif"}
                    If lsImageExtentions.Contains(myImageInfo.Extension) Then
                        Dim image1 As Image = Image.FromFile(sImagePath, True)
                        For Each pi As System.Drawing.Imaging.PropertyItem In image1.PropertyItems
                            lsReturn.Add(pi.Id.ToString & " : " & New System.Text.ASCIIEncoding().GetString(pi.Value))
                        Next
                    Else
                        MessageBox.Show("Please provide a valid image file path.")
                    End If
                Else
                    MessageBox.Show("Please provide a valid image file path.")
                End If
            Else
                MessageBox.Show("Please provide a valid image file path.")
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
        Return lsReturn
    End Function

 

0 0
replied on March 13, 2015

Thanks Bert, these are great information.

I am not a developer, but I will play with the code.   Currently I have our developer looking into this to extract the information from the picture within LF Workflow.  We are still trying to validate to see if we can translate the value into Street address.   Thanks for the code
 

0 0
replied on March 13, 2015

The code posted above only converts to ASCII, so items that are of other types will not have values added to the string list.  To read the GPS data, you will have research how to decode the Relational data types and build code to handle all the different data types available in the geotags.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.