diff --git a/tests/sample/pictures/dir1/test1/flickr_jerquiaga_2394751088_cc-by-nc.jpg b/tests/sample/pictures/dir1/test1/flickr_jerquiaga_2394751088_cc-by-nc.jpg new file mode 100644 index 0000000..f1b8c91 Binary files /dev/null and b/tests/sample/pictures/dir1/test1/flickr_jerquiaga_2394751088_cc-by-nc.jpg differ diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 3dd1890..e44e8a0 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -18,7 +18,8 @@ REF = { 'dir1/test1': { 'title': 'An example sub-category', 'thumbnail': '11.jpg', - 'medias': ['11.jpg', 'archlinux-kiss-1024x640.png'], + 'medias': ['11.jpg', 'archlinux-kiss-1024x640.png', + 'flickr_jerquiaga_2394751088_cc-by-nc.jpg'], }, 'dir1/test2': { 'title': 'Test2', diff --git a/tests/test_image.py b/tests/test_image.py index 15e9db0..9502a4b 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -68,3 +68,22 @@ def test_exif_copy(tmpdir): raw, simple = get_exif_tags(dst_file) assert not raw assert not simple + + +def test_exif_gps(tmpdir): + """Test reading out correct geo tags""" + test_image = 'flickr_jerquiaga_2394751088_cc-by-nc.jpg' + src_file = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'dir1', 'test1', + test_image) + dst_file = str(tmpdir.join(test_image)) + + settings = create_settings(img_size=(400, 300), copy_exif_data=True) + generate_image(src_file, dst_file, settings) + raw, simple = get_exif_tags(dst_file) + assert 'gps' in simple + + lat = 35.266666 + lon = -117.216666 + + assert abs(simple['gps']['lat'] - lat) < 0.0001 + assert abs(simple['gps']['lon'] - lon) < 0.0001 diff --git a/tests/test_zip.py b/tests/test_zip.py index 702e0c3..d3e3e98 100644 --- a/tests/test_zip.py +++ b/tests/test_zip.py @@ -31,7 +31,8 @@ def test_zipped_correctly(tmpdir): assert os.path.basename(zipped1[0]) == 'archive.zip' zip_file = zipfile.ZipFile(zipped1[0], 'r') - expected = ('11.jpg', 'archlinux-kiss-1024x640.png') + expected = ('11.jpg', 'archlinux-kiss-1024x640.png', + 'flickr_jerquiaga_2394751088_cc-by-nc.jpg') for filename in zip_file.namelist(): assert filename in expected