From 1a7cb317be40c275d35ea975a858bbc81ef3cdd0 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 9 Aug 2017 02:39:53 +0300 Subject: [PATCH] load image before getting channels --- PIL/Image.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PIL/Image.py b/PIL/Image.py index f67009452..db26b9f20 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -1968,6 +1968,7 @@ class Image(object): ("A" for alpha channel of "RGBA"). :returns: An image in "L" mode. """ + self.load() if isStringType(channel) and len(channel) == 1: if channel in self.im.mode: