From ed4b58aa0dd797906939dab2f16d5f687aa9f72f Mon Sep 17 00:00:00 2001 From: Jaisen Mathai Date: Fri, 9 Oct 2020 00:55:14 -0700 Subject: [PATCH] Add support for PNG photos. #361 (#383) --- elodie/media/photo.py | 2 +- elodie/tests/files/photo.png | Bin 0 -> 4104 bytes elodie/tests/media/photo_test.py | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 elodie/tests/files/photo.png diff --git a/elodie/media/photo.py b/elodie/media/photo.py index b070877..07f3e04 100644 --- a/elodie/media/photo.py +++ b/elodie/media/photo.py @@ -28,7 +28,7 @@ class Photo(Media): __name__ = 'Photo' #: Valid extensions for photo files. - extensions = ('arw', 'cr2', 'dng', 'gif', 'heic', 'jpeg', 'jpg', 'nef', 'rw2') + extensions = ('arw', 'cr2', 'dng', 'gif', 'heic', 'jpeg', 'jpg', 'nef', 'png', 'rw2') def __init__(self, source=None): super(Photo, self).__init__(source) diff --git a/elodie/tests/files/photo.png b/elodie/tests/files/photo.png new file mode 100644 index 0000000000000000000000000000000000000000..3617569a1db3e1312bf2a6919fa32560fc30b3e1 GIT binary patch literal 4104 zcmZ`+c|4Tu*T2V-eW|f4W-QTS24l~RWo%<>vOSUzjma{$8H_DUvXm?-QbMEbgccN8 z!YCmLBeG;)Dv_*HzfrwU&-=W;_xgO!ea?N(_j|7ET-W*MBw{U%c{s&50RZ5^m>5_w zG-y}Y_b|Saf~|=Fzr?ijKu$$^K zd9(EC&DoG|!|D$nJV2z=Uoz$OHD|sEIB^Fm{|Hu7mq zd2WEFE@XxaDyJ)vmZ@&rwhB3>8zwq+I(10YdGpoQtshCyAK~W*_)AyC_yZCQpq1gKp!X@m-GEx;$+LOeps3;)Aa7fiWMVU% zU%=nEJrA`l}3Ug0I zOgkpK`zSc0Dl1+-Gt5fw=-p^MB=ltuy%DxgP6l1T6m^127So&h2r4cg@Iks??S^gI z4RPc->A%{GKh#9O62d&c(Eq*ap?QdXcDqwXp~x%YBYVxry>=*Gq_5v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h^sglUlg9u@ zbPMqCBYF7xKz8$|H!9VBxMZ|iLao+X@9tl@ zQA6W5?cbsQNAI75>Ybs0^@g)z{xVL#xu!N&q{ XY%|ljpPriCZ9a^lr9p+hOU!=&s(>m^ literal 0 HcmV?d00001 diff --git a/elodie/tests/media/photo_test.py b/elodie/tests/media/photo_test.py index 08019cb..dd391ee 100644 --- a/elodie/tests/media/photo_test.py +++ b/elodie/tests/media/photo_test.py @@ -35,6 +35,7 @@ def test_photo_extensions(): assert 'jpg' in extensions assert 'jpeg' in extensions assert 'nef' in extensions + assert 'png' in extensions assert 'rw2' in extensions valid_extensions = Photo.get_valid_extensions() @@ -355,6 +356,7 @@ def test_various_types(): 'dng': (2009, 10, 20, 9, 10, 46, 1, 293, 0), 'heic': (2019, 5, 26, 10, 33, 20, 6, 146, 0), 'nef': (2008, 10, 24, 9, 12, 56, 4, 298, 0), + 'png': (2015, 1, 18, 12, 1, 1, 6, 18, 0), 'rw2': (2014, 11, 19, 23, 7, 44, 2, 323, 0) }