-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.Hasn't worked in 20 yearsMemory
Milestone
Description
There's a venerable old PIL bug which caused Image.save(optimize=True) to fail with JPEGs when the file size is over a certain threshold. The earliest reference I could find dates back to 1999:
http://mail.python.org/pipermail/image-sig/1999-December/000942.html
The workaround commonly used is to either hardcode something like this:
ImageFile.MAXBLOCK = <empirically determined constant (i.e. wild guess)>
or the more dynamic approach used in e.g. matthewwithanm/django-imagekit#50:
ImageFile.MAXBLOCK = max(img.size) ** 2
This seems like exactly the kind of thing Pillow could just fix once and for all.
Metadata
Metadata
Assignees
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.Hasn't worked in 20 yearsMemory