mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-01 12:56:18 +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:
|
if mpheader[45057] > 1:
|
||||||
# It's actually an MPO
|
# It's actually an MPO
|
||||||
from .MpoImagePlugin import MpoImageFile
|
from .MpoImagePlugin import MpoImageFile
|
||||||
im = MpoImageFile(fp, filename)
|
# Don't reload everything, just convert it.
|
||||||
|
im = MpoImageFile.adopt(im, mpheader)
|
||||||
except (TypeError, IndexError):
|
except (TypeError, IndexError):
|
||||||
# It is really a JPEG
|
# It is really a JPEG
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user