diff --git a/README.md b/README.md index 1776b12c..a6fa4ed5 100644 --- a/README.md +++ b/README.md @@ -40,4 +40,4 @@ Sr no | Project Name | Author 18 | [Send emails](https://github.com/chavarera/python-mini-projects/tree/master/projects/send%20email%20from%20CSV) | [Mitesh](https://github.com/Mitesh2499) 19 | [Get Ipaddress and Hostname of Website](https://github.com/chavarera/python-mini-projects/tree/master/projects/Find%20Out%20Hostname%20and%20IP%20address) | [Nuh Mohammed](https://github.com/NuhMohammed)| 20 | [Progressbar using tqdm](https://github.com/chavarera/python-mini-projects/tree/master/projects/Terminal%20Progress%20Bar%20with%20Images%20Resizing) | [Mitesh](https://github.com/Mitesh2499) - +21 | [Get meta information of images](https://github.com/Xlgd/python-mini-projects/tree/master/projects/Get%20meta%20information%20of%20images) | [Gaodong](https://github.com/xlgd) diff --git a/projects/Get meta information of images/README.md b/projects/Get meta information of images/README.md new file mode 100644 index 00000000..a8751e93 --- /dev/null +++ b/projects/Get meta information of images/README.md @@ -0,0 +1,14 @@ +## Get meta information of images + +### usage + +python get_meta_from_pic image_name + +### note + +Make sure the picture contains location information, otherwise the location cannot be obtained + +you need fill in your email address to use the function in gps_utils.py: +```python +geolocator = Nominatim(user_agent = "your email") +``` \ No newline at end of file diff --git a/projects/Get meta information of images/gps_utils.py b/projects/Get meta information of images/gps_utils.py index b6c43466..d89b4964 100644 --- a/projects/Get meta information of images/gps_utils.py +++ b/projects/Get meta information of images/gps_utils.py @@ -5,7 +5,10 @@ def format_lati_long(data): list_tmp=str(data).replace('[', '').replace(']', '').split(',') list=[ele.strip() for ele in list_tmp] - data_sec = int(list[-1].split('/')[0]) /(int(list[-1].split('/')[1])*3600) + if (list[-1].find('/') != -1): + data_sec = int(list[-1].split('/')[0]) /(int(list[-1].split('/')[1])*3600) + else: + data_sec = int(list[-1])/3600 data_minute = int(list[1])/60 data_degree = int(list[0]) result=data_degree + data_minute + data_sec