コード例 #1
0
    def test_pdf(self):
        file = get_test_data_path('mb.pdf')

        with open(file, 'rb') as f:
            self.assertEqual(imageinfo.identify(f.read()),
                             (0, 0, 'application/pdf', '.pdf', 10362))
コード例 #2
0
    def test_tiff(self):
        file = get_test_data_path('mb.tiff')

        with open(file, 'rb') as f:
            self.assertEqual(imageinfo.identify(f.read()),
                             (140, 96, 'image/tiff', '.tiff', 12509))
コード例 #3
0
    def test_webp_vp8x(self):
        file = get_test_data_path('mb-vp8x.webp')

        with open(file, 'rb') as f:
            self.assertEqual(imageinfo.identify(f.read()),
                             (140, 96, 'image/webp', '.webp', 6858))
コード例 #4
0
    def test_jpeg(self):
        file = get_test_data_path('mb.jpg')

        with open(file, 'rb') as f:
            self.assertEqual(imageinfo.identify(f.read()),
                             (140, 96, 'image/jpeg', '.jpg', 8550))
コード例 #5
0
    def test_png(self):
        file = get_test_data_path('mb.png')

        with open(file, 'rb') as f:
            self.assertEqual(imageinfo.identify(f.read()),
                             (140, 96, 'image/png', '.png', 11137))
コード例 #6
0
    def test_gif(self):
        file = get_test_data_path('mb.gif')

        with open(file, 'rb') as f:
            self.assertEqual(imageinfo.identify(f.read()),
                             (140, 96, 'image/gif', '.gif', 5806))