mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 21:56:56 +03:00
Remove extra load() calls
This commit is contained in:
parent
3b09f436bd
commit
d8ef314205
|
@ -349,7 +349,6 @@ class ImageCmsTransform(Image.ImagePointHandler):
|
|||
return self.apply(im)
|
||||
|
||||
def apply(self, im: Image.Image, imOut: Image.Image | None = None) -> Image.Image:
|
||||
im.load()
|
||||
if imOut is None:
|
||||
imOut = Image.new(self.output_mode, im.size, None)
|
||||
self.transform.apply(im.getim(), imOut.getim())
|
||||
|
@ -357,7 +356,6 @@ class ImageCmsTransform(Image.ImagePointHandler):
|
|||
return imOut
|
||||
|
||||
def apply_in_place(self, im: Image.Image) -> Image.Image:
|
||||
im.load()
|
||||
if im.mode != self.output_mode:
|
||||
msg = "mode mismatch"
|
||||
raise ValueError(msg) # wrong output mode
|
||||
|
|
|
@ -59,7 +59,6 @@ class _Operand:
|
|||
if im2 is None:
|
||||
# unary operation
|
||||
out = Image.new(mode or im_1.mode, im_1.size, None)
|
||||
im_1.load()
|
||||
try:
|
||||
op = getattr(_imagingmath, f"{op}_{im_1.mode}")
|
||||
except AttributeError as e:
|
||||
|
@ -86,7 +85,6 @@ class _Operand:
|
|||
if im_2.size != size:
|
||||
im_2 = im_2.crop((0, 0) + size)
|
||||
out = Image.new(mode or im_1.mode, im_1.size, None)
|
||||
im_1.load()
|
||||
try:
|
||||
op = getattr(_imagingmath, f"{op}_{im_1.mode}")
|
||||
except AttributeError as e:
|
||||
|
|
Loading…
Reference in New Issue
Block a user