1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #29705 -- Fixed ImageField RuntimeError crash for WebP files.

This commit is contained in:
winkidney
2018-08-22 19:34:51 +08:00
committed by Tim Graham
parent 586a9dc429
commit c69d40f943
3 changed files with 10 additions and 0 deletions

View File

@@ -343,6 +343,12 @@ class GetImageDimensionsTests(unittest.TestCase):
size = images.get_image_dimensions(fh)
self.assertEqual(size, (None, None))
def test_webp(self):
img_path = os.path.join(os.path.dirname(__file__), 'test.webp')
with open(img_path, 'rb') as fh:
size = images.get_image_dimensions(fh)
self.assertEqual(size, (540, 405))
class FileMoveSafeTests(unittest.TestCase):
def test_file_move_overwrite(self):