Do not reduce size if tile already loaded

Co-Authored-By: Alexander Karpinsky <homm86@gmail.com>
This commit is contained in:
Andrew Murray 2020-03-20 18:14:08 +11:00 committed by Andrew Murray
parent 4f9118bdbd
commit 6d8f2f95db

View File

@ -216,7 +216,7 @@ class Jpeg2KImageFile(ImageFile.ImageFile):
self._reduce = value
def load(self):
if self._reduce:
if self.tile and self._reduce:
power = 1 << self._reduce
adjust = power >> 1
self._size = (
@ -224,7 +224,6 @@ class Jpeg2KImageFile(ImageFile.ImageFile):
int((self.size[1] + adjust) / power),
)
if self.tile:
# Update the reduce and layers settings
t = self.tile[0]
t3 = (t[3][0], self._reduce, self.layers, t[3][3], t[3][4])