From 34f2a5bd2b10741cb79957d02773c32425e539da Mon Sep 17 00:00:00 2001 From: Gaodong <1120496618@qq.com> Date: Thu, 9 Jul 2020 11:11:55 +0800 Subject: [PATCH 1/3] Update README.md add "Get meta information of images" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 4df96b11cb9dfd3e09c9af3ff16ed8c0797105a8 Mon Sep 17 00:00:00 2001 From: Gaodong <1120496618@qq.com> Date: Thu, 9 Jul 2020 11:46:38 +0800 Subject: [PATCH 2/3] add README.md add "get meta information of images" readme.md --- projects/Get meta information of images/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 projects/Get meta information of images/README.md 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..9c3da37e --- /dev/null +++ b/projects/Get meta information of images/README.md @@ -0,0 +1,9 @@ +## 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 \ No newline at end of file From 3414c61e19e1043b4a7f03ea80b46d042049b0c2 Mon Sep 17 00:00:00 2001 From: Gaodong <1120496618@qq.com> Date: Thu, 9 Jul 2020 14:52:44 +0800 Subject: [PATCH 3/3] update README.md and fix a bug --- projects/Get meta information of images/README.md | 7 ++++++- projects/Get meta information of images/gps_utils.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/Get meta information of images/README.md b/projects/Get meta information of images/README.md index 9c3da37e..a8751e93 100644 --- a/projects/Get meta information of images/README.md +++ b/projects/Get meta information of images/README.md @@ -6,4 +6,9 @@ python get_meta_from_pic image_name ### note -Make sure the picture contains location information, otherwise the location cannot be obtained \ No newline at end of file +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