Giter Site home page Giter Site logo

aidenpearce369 / exif-gps-tracer Goto Github PK

View Code? Open in Web Editor NEW
39.0 4.0 11.0 6 KB

A python script which allows you to parse GeoLocation data from your Image files stored in a dataset.It also produces output in CSV file and also in HTML Google Maps

Python 100.00%
python3 exif exif-data-extraction exif-metadata exif-gps gps-tracker gps-tracking gps-location image-processing information-security

exif-gps-tracer's People

Contributors

aidenpearce369 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

exif-gps-tracer's Issues

Wasn't working but I think I fixed it by doing this.

So I scraped a bunch of photos, put it into a folder and then put the folder as the dataset and initially got this:

PS C:\Users\1\Documents\scripts\exif-gps-tracer> py plotmap.py

        #       #    # # ######       #     # #####   ####           #    #####    ##    ####  ###### #####
        #        #  #  # #            #       #    # #               #    #    #  #  #  #    # #      #    #
        #####     ##   # #####  ##### #  #### #    #  ####  #####    #    #    # #    # #      #####  #    #
        #         ##   # #            #     # #####       #          #    #####  ###### #      #      #####
        #        #  #  # #            #     # #      #    #          #    #   #  #    # #    # #      #   #
        ####### #    # # #             #####  #       ####           #    #    # #    #  ####  ###### #    #


[+] Enter path for your dataset : D:\1\2\3\
No EXIF metadata found for D:\1\2\3\/file1.jpg
Traceback (most recent call last):
  File "C:\Users\1\Documents\scripts\exif-gps-tracer\plotmap.py", line 21, in <module>
    gps,time=getdata()
  File "C:\Users\1\Documents\scripts\exif-gps-tracer\getdata.py", line 13, in getdata
    gpstags = get_gpstags(exif,filename)
  File "C:\Users\1\Documents\scripts\exif-gps-tracer\getexif.py", line 25, in get_gpstags
UnboundLocalError: local variable 'geotagging' referenced before assignment

Pretty much, it wasn't going to the next file. I'm thinking it's because there was no exif data, so python bugged out when it tried to return the variable geotagging. I simply went into the getexif.py file and added 'else: geotagging = 0' like this, so that the variable was given a value and python wouldn't freak out:

def get_gpstags(exif,filename):
    if not exif:
        print("No EXIF metadata found for "+filename)
    if exif:
        geotagging = {}
        for (idx, tag) in TAGS.items():
            if tag == 'GPSInfo':
                if idx not in exif:
                    print("No EXIF GeoTag found on "+filename)
                    break

                for (key, val) in GPSTAGS.items():
                    if key in exif[idx]:
                        geotagging[val] = exif[idx][key]
    else:
        geotagging = 0

    return geotagging

After this, it seemed to go through all the files (unfortunately no exif data in any of them so I couldn't test further). Then the script printed this and stopped:

Data processed from the given datasets
CSV file created successfully...(tracedlocation.csv)
Traceback (most recent call last):
  File "C:\Users\1\Documents\scripts\exif-gps-tracer\plotmap.py", line 41, in <module>
    gmap = gmplot.GoogleMapPlotter(gps[l-1][0],gps[l-1][1],30,apikey=API_KEY)
  File "C:\Users\1\AppData\Local\Programs\Python\Python39\lib\site-packages\gmplot\gmplot.py", line 390, in __init__
    self.center = (float(lat), float(lng))
TypeError: float() argument must be a string or a number, not 'NoneType'

I'm guessing this is because there were no values for gps data that it could parse. I'm guessing had there been GPS data, it would have finished up fine, but I don't have any pictures with exif data to test this on, unfortunately. Otherwise, looks like a pretty cool program that you made. Hopefully I'll be able to use it on something in the future (especially since I went out of my way to make a Google Maps Javascript API key).

Dont't run

[+] Enter path for your dataset : /home/joker2020/Downloads/index.jpeg/
Traceback (most recent call last):
File "/home/Makali/soft/exif-gps-tracer/plotmap.py", line 21, in
gps,time=getdata()
File "/home/Makali/soft/exif-gps-tracer/getdata.py", line 6, in getdata
file_data=scanfiles(path)
File "/home/Makali/soft/exif-gps-tracer/scanfiles.py", line 6, in scanfiles
fnames = os.listdir(path)
NotADirectoryError: [Errno 20] Not a directory: '/home/Makali/Downloads/index.jpeg/'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.