convert Jpeg to Mpo instead of re-reading everything

This commit is contained in:
Adrien CLERC 2019-02-15 22:08:31 +01:00
parent ac5dd15e16
commit 4a87e067a2

View File

@ -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