{"action":"opened","issue":{"url":"https://api.github.com/repos/Rainerino/sky_eye/issues/1","repository_url":"https://api.github.com/repos/Rainerino/sky_eye","labels_url":"https://api.github.com/repos/Rainerino/sky_eye/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Rainerino/sky_eye/issues/1/comments","events_url":"https://api.github.com/repos/Rainerino/sky_eye/issues/1/events","html_url":"https://github.com/Rainerino/sky_eye/issues/1","id":352811833,"node_id":"MDU6SXNzdWUzNTI4MTE4MzM=","number":1,"title":"geotag bug","user":{"login":"Rainerino","id":18321830,"node_id":"MDQ6VXNlcjE4MzIxODMw","avatar_url":"https://avatars0.githubusercontent.com/u/18321830?v=4","gravatar_id":"","url":"https://api.github.com/users/Rainerino","html_url":"https://github.com/Rainerino","followers_url":"https://api.github.com/users/Rainerino/followers","following_url":"https://api.github.com/users/Rainerino/following{/other_user}","gists_url":"https://api.github.com/users/Rainerino/gists{/gist_id}","starred_url":"https://api.github.com/users/Rainerino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rainerino/subscriptions","organizations_url":"https://api.github.com/users/Rainerino/orgs","repos_url":"https://api.github.com/users/Rainerino/repos","events_url":"https://api.github.com/users/Rainerino/events{/privacy}","received_events_url":"https://api.github.com/users/Rainerino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-22T05:50:26Z","updated_at":"2018-08-22T05:50:26Z","closed_at":null,"author_association":"OWNER","body":"#Run unittest output:\r\n```python\r\n...EE.........\r\n======================================================================\r\nERROR: test_read_geo_tag (__main__.TestGeoTag)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/home/yiyi/Documents/github/sky_eye/GeoTag/test_geotag.py\", line 117, in test_read_geo_tag\r\n    self.assertEqual(geotag.read_geo_tag('images/Apples.jpg'),\r\n  File \"/home/yiyi/Documents/github/sky_eye/GeoTag/geotag.py\", line 196, in read_geo_tag\r\n    piexif.GPSIFD.GPSLatitudeRef, bytes('N', 'utf-8')) \\\r\nTypeError: str() takes at most 1 argument (2 given)\r\n\r\n======================================================================\r\nERROR: test_write_geo_tag (__main__.TestGeoTag)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/home/yiyi/Documents/github/sky_eye/GeoTag/test_geotag.py\", line 129, in test_write_geo_tag\r\n    self.assertEqual(geotag.read_geo_tag('images/Apples_cpy.jpg'),\r\n  File \"/home/yiyi/Documents/github/sky_eye/GeoTag/geotag.py\", line 196, in read_geo_tag\r\n    piexif.GPSIFD.GPSLatitudeRef, bytes('N', 'utf-8')) \\\r\nTypeError: str() takes at most 1 argument (2 given)\r\n\r\n----------------------------------------------------------------------\r\nRan 14 tests in 1.500s\r\n\r\nFAILED (errors=2)\r\n```\r\n\r\n\r\nAfter change:\r\n```python\r\n    try: \r\n        lat_ref = exif_dict['GPS'].get(\r\n                  piexif.GPSIFD.GPSLatitudeRef, bytes('N', 'utf-8')) \\\r\n                  .decode('utf-8')\r\n        lat = lat_dms_to_dec(exif_dict['GPS'][piexif.GPSIFD.GPSLatitude],\r\n                             lat_ref)\r\n    except KeyError:\r\n        lat = None\r\n\r\n    try:\r\n        lon_ref = exif_dict['GPS'].get(\r\n                  piexif.GPSIFD.GPSLongitudeRef, bytes('E', 'utf-8')) \\\r\n                  .decode('utf-8')\r\n        lon = lon_dms_to_dec(exif_dict['GPS'][piexif.GPSIFD.GPSLongitude],\r\n                             lon_ref)\r\n    except KeyError:\r\n        lon = None\r\n```\r\n\r\nto \r\n```python\r\n\r\n    try: \r\n        lat_ref = exif_dict['GPS'].get(\r\n                  piexif.GPSIFD.GPSLatitudeRef, bytes('N')) \\\r\n                  .decode('utf-8')\r\n        lat = lat_dms_to_dec(exif_dict['GPS'][piexif.GPSIFD.GPSLatitude],\r\n                             lat_ref)\r\n    except KeyError:\r\n        lat = None\r\n\r\n    try:\r\n        lon_ref = exif_dict['GPS'].get(\r\n                  piexif.GPSIFD.GPSLongitudeRef, bytes('E')) \\\r\n                  .decode('utf-8')\r\n        lon = lon_dms_to_dec(exif_dict['GPS'][piexif.GPSIFD.GPSLongitude],\r\n                             lon_ref)\r\n    except KeyError:\r\n        lon = None\r\n```\r\n\r\nThe error went away. I dont know why that was a problem, but the image I used are first tagged geotag.write(), and then read() from to tag other newly created images. \r\n\r\nAfter I fixed it, unittest still fails:\r\n\r\n```python\r\n...FF.........\r\n======================================================================\r\nFAIL: test_read_geo_tag (__main__.TestGeoTag)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/home/yiyi/Documents/github/sky_eye/GeoTag/test_geotag.py\", line 118, in test_read_geo_tag\r\n    (49.0278408, -122.7727156, 30, None))\r\nAssertionError: Tuples differ: (49.0166667, -122.7666667, 30.... != (49.0278408, -122.7727156, 30,...\r\n\r\nFirst differing element 0:\r\n49.0166667\r\n49.0278408\r\n\r\n- (49.0166667, -122.7666667, 30.0, None)\r\n+ (49.0278408, -122.7727156, 30, None)\r\n\r\n======================================================================\r\nFAIL: test_write_geo_tag (__main__.TestGeoTag)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/home/yiyi/Documents/github/sky_eye/GeoTag/test_geotag.py\", line 130, in test_write_geo_tag\r\n    (-49.9120223, -98.2690366, 261.64, None))\r\nAssertionError: Tuples differ: (-49.9, -98.2666667, 261.0, No... != (-49.9120223, -98.2690366, 261...\r\n\r\nFirst differing element 0:\r\n-49.9\r\n-49.9120223\r\n\r\n- (-49.9, -98.2666667, 261.0, None)\r\n?                 ---      ^\r\n\r\n+ (-49.9120223, -98.2690366, 261.64, None)\r\n?       ++++++        +++        ^^\r\n\r\n\r\n----------------------------------------------------------------------\r\nRan 14 tests in 1.309s\r\n\r\nFAILED (failures=2)\r\n```\r\n"}}
{"actor":{"display_login":"Rainerino"}}