mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
convert Jpeg to Mpo instead of re-reading everything
This commit is contained in:
parent
ac5dd15e16
commit
4a87e067a2
|
@ -786,7 +786,8 @@ def jpeg_factory(fp=None, filename=None):
|
|||
if mpheader[45057] > 1:
|
||||
# It's actually an MPO
|
||||
from .MpoImagePlugin import MpoImageFile
|
||||
im = MpoImageFile(fp, filename)
|
||||
# Don't reload everything, just convert it.
|
||||
im = MpoImageFile.adopt(im, mpheader)
|
||||
except (TypeError, IndexError):
|
||||
# It is really a JPEG
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user