diff --git a/sphinx/util/images.py b/sphinx/util/images.py index d130ade326..d445acb057 100644 --- a/sphinx/util/images.py +++ b/sphinx/util/images.py @@ -26,7 +26,7 @@ def get_image_size(filename): if size[0] == -1: size = None - if Image: # fallback to PIL + if size is None and Image: # fallback to PIL im = Image.open(filename) size = im.size try: