-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Inconsistent behavior opening truncated JPEG file #2977
Copy link
Copy link
Closed
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.NumPy
Description
What did you do?
from PIL import Image
import numpy as np
a=Image.open('aa.jpg')
b1=np.array(a)
b2=np.array(a)What did you expect to happen?
b1.shape == b2.shape == (H,W,3)
What actually happened?
Surprisingly, b1.shape == () and b2.shape == (H, W, 3).
b1:
array(<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=2000x2000 at 0x7FCD...48>, dtype=object)
I have a large RAM available (>50G).
This is consistently reproduced for a specific image file:
https://farm5.staticflickr.com/4360/36444958735_32c0410b64_o.jpg
What versions of Pillow and Python are you using?
5.1.0.dev0 && 4.3.0 (pip version)
Python 3.6.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.NumPy