B4J Tutorial Get EXIF GPS information and show images in google maps

Discussion in 'B4J Tutorials' started by mark35at, Aug 5, 2018.

  1. mark35at

    mark35at Well-Known Member Licensed User

    My Aim: Extract the gps information from all images in a directory and generate a html file to view in a browser showing all images in google maps at the coordinates they were taken.

    As a follow-up to my question in this thread: Link and the code from canalrun hier: Link, I will post my whole project for those who are interested.

    You will need the latest version of metadata-extractor (Link). Version 2.6.2 does not seem to work for the newer Nikon cameras. Extract the two files and put them in your other libraries directory.

    To use the program I would recommend the following:

    1. Create a directory eg. Img2HTM (change line 42 if you want another directory)
    2. Extract the GM_Utils.zip so that it is a subdirectory of 1 above
    3. Create a sub directory in 1 eg. images

    Now you will have eg.:


    Now put your images in the images subdirectory, the ones including gps info would be a good idea.

    Run the B4J app and tell it where to find your images. Generate the html and view it in your browser.

    If all has gone well, you should see something like this. Clicking on an icon will open the image.



    Have fun.

    Attached Files:

  2. miker2069

    miker2069 Active Member Licensed User

    Very nice! Took a few minutes to get it up and running and works very well. Just added a line or two to handle the situation where it can't pull long/lat for a pic (just skips it). I tested it on some paris pics from a few years back and worked very nicely. Well Done! parispicstest-min2.jpg
    DonManfred and mark35at like this.
  3. TomDuncan

    TomDuncan Active Member Licensed User

    Very nice indeed.
    I had to add a check for strings not matching.
    around line 90

    End Try
  4. wl

    wl Well-Known Member Licensed User

    very nice,

    I have one issue though: it seems that only landscape pictures are displayed correctly, portrait pictures seem to be displayed in a rotated way ?

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice