From 245e24dcf3327e46b7ce2ea4a4b667c0d90bd1c0 Mon Sep 17 00:00:00 2001 From: Sachin Kelkar Date: Sun, 12 Feb 2017 01:19:36 +0530 Subject: Add sources of images, remove copyrighted image --- test/mitmproxy/contentviews/test_image.py | 2 +- test/mitmproxy/contentviews/test_image_parser.py | 30 +++++++++++++++++------ test/mitmproxy/data/all.jpeg | Bin 0 -> 230334 bytes test/mitmproxy/data/image-err1.jpg | Bin 82674 -> 0 bytes test/mitmproxy/data/image_parser/README.md | 17 +++++++++++++ test/mitmproxy/data/image_parser/all.jpeg | Bin 0 -> 230334 bytes test/mitmproxy/data/image_parser/image-err1.jpg | Bin 82674 -> 0 bytes 7 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 test/mitmproxy/data/all.jpeg delete mode 100644 test/mitmproxy/data/image-err1.jpg create mode 100644 test/mitmproxy/data/image_parser/README.md create mode 100644 test/mitmproxy/data/image_parser/all.jpeg delete mode 100644 test/mitmproxy/data/image_parser/image-err1.jpg (limited to 'test') diff --git a/test/mitmproxy/contentviews/test_image.py b/test/mitmproxy/contentviews/test_image.py index 9e7e28f5..e3dfb714 100644 --- a/test/mitmproxy/contentviews/test_image.py +++ b/test/mitmproxy/contentviews/test_image.py @@ -8,7 +8,7 @@ def test_view_image(): for img in [ "mitmproxy/data/image.png", "mitmproxy/data/image.gif", - "mitmproxy/data/image-err1.jpg", + "mitmproxy/data/all.jpeg", "mitmproxy/data/image.ico" ]: with open(tutils.test_data.path(img), "rb") as f: diff --git a/test/mitmproxy/contentviews/test_image_parser.py b/test/mitmproxy/contentviews/test_image_parser.py index 1595bba5..3c8bfdf7 100644 --- a/test/mitmproxy/contentviews/test_image_parser.py +++ b/test/mitmproxy/contentviews/test_image_parser.py @@ -136,16 +136,32 @@ def test_parse_gif(filename, metadata): ('Size', '717 x 558 px') ], # check multiple segments - "mitmproxy/data/image_parser/image-err1.jpg": [ + "mitmproxy/data/image_parser/all.jpeg": [ ('Format', 'JPEG (ISO 10918)'), ('jfif_version', '(1, 1)'), - ('jfif_density', '(72, 72)'), + ('jfif_density', '(300, 300)'), ('jfif_unit', '1'), - ('image_description', '<> on December 4, 2009 in Washington, DC.'), - ('make', 'Canon'), ('model', 'Canon EOS-1D Mark III'), - ('artist', 'Alex Wong'), - ('primary_chromaticities', '@\x00\x00\x00d'), - ('copyright', '2009 Getty Images') + ('comment', 'b\'BARTOLOMEO DI FRUOSINO\\r\\n(b. ca. 1366, Firenze, d. 1441, ' + 'Firenze)\\r\\n\\r\\nInferno, from the Divine Comedy by Dante (Folio 1v)' + '\\r\\n1430-35\\r\\nTempera, gold, and silver on parchment, 365 x 265 mm' + '\\r\\nBiblioth\\xe8que Nationale, Paris\\r\\n\\r\\nThe codex in Paris ' + 'contains the text of the Inferno, the first of three books of the Divine ' + 'Comedy, the masterpiece of the Florentine poet Dante Alighieri (1265-1321).' + ' The codex begins with two full-page illuminations. On folio 1v Dante and ' + 'Virgil stand within the doorway of Hell at the upper left and observe its ' + 'nine different zones. Dante and Virgil are to wade through successive ' + 'circles teeming with images of the damned. The gates of Hell appear in ' + 'the middle, a scarlet row of open sarcophagi before them. Devils orchestrate' + ' the movements of the wretched souls.\\r\\n\\r\\nThe vision of the fiery ' + 'inferno follows a convention established by ' + 'Nardo di Cione\\\'s fresco in the church of Santa Maria Novella, Florence.' + ' Of remarkable vivacity and intensity of expression, the illumination is ' + 'executed in Bartolomeo\\\'s late style.\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n' + '--- Keywords: --------------\\r\\n\\r\\nAuthor: BARTOLOMEO DI FRUOSINO' + '\\r\\nTitle: Inferno, from the Divine Comedy by Dante (Folio 1v)\\r\\nTime-line:' + ' 1401-1450\\r\\nSchool: Italian\\r\\nForm: illumination\\r\\nType: other\\r\\n\''), + ('Size', '750 x 1055 px') ], }.items()) def test_parse_jpeg(filename, metadata): diff --git a/test/mitmproxy/data/all.jpeg b/test/mitmproxy/data/all.jpeg new file mode 100644 index 00000000..ea5d8d0f Binary files /dev/null and b/test/mitmproxy/data/all.jpeg differ diff --git a/test/mitmproxy/data/image-err1.jpg b/test/mitmproxy/data/image-err1.jpg deleted file mode 100644 index 1b251e6e..00000000 Binary files a/test/mitmproxy/data/image-err1.jpg and /dev/null differ diff --git a/test/mitmproxy/data/image_parser/README.md b/test/mitmproxy/data/image_parser/README.md new file mode 100644 index 00000000..c23409bf --- /dev/null +++ b/test/mitmproxy/data/image_parser/README.md @@ -0,0 +1,17 @@ +# Sources of the images used + +## PNG + +`aspect.png` - http://pngimg.com/upload/water_PNG3290.png +All other PNGs are from the [PNGTestSuite](http://www.schaik.com/pngsuite/) + +# GIF + +All the GIFs are from the Pillow repository [here](https://github.com/python-pillow/Pillow/tree/master/Tests/images) + +# JPEG + +`app1.jpeg` - https://commons.wikimedia.org/wiki/File:PT05_ubt.jpeg +`all.jpeg` - https://commons.wikimedia.org/wiki/Category:Dante's_Inferno#/media/File:Bartolomeo_Di_Fruosino_-_Inferno,_from_the_Divine_Comedy_by_Dante_(Folio_1v)_-_WGA01339.jpg +`comment.jpg` has been taken from [here](https://commons.wikimedia.org/wiki/File:JPEG_example_image.jpg) and has a comment added locally +All other JPEGs are from the Pillow repository [here](https://github.com/python-pillow/Pillow/tree/master/Tests/images) diff --git a/test/mitmproxy/data/image_parser/all.jpeg b/test/mitmproxy/data/image_parser/all.jpeg new file mode 100644 index 00000000..ea5d8d0f Binary files /dev/null and b/test/mitmproxy/data/image_parser/all.jpeg differ diff --git a/test/mitmproxy/data/image_parser/image-err1.jpg b/test/mitmproxy/data/image_parser/image-err1.jpg deleted file mode 100644 index 1b251e6e..00000000 Binary files a/test/mitmproxy/data/image_parser/image-err1.jpg and /dev/null differ -- cgit v1.2.3