# HG changeset patch -- Bitbucket.org
# Project pil-2009-raclette
# URL http://bitbucket.org/effbot/pil-2009-raclette/overview
# User Fredrik Lundh <fredrik@effbot.org>
# Date 1272193085 -7200
# Node ID fb7ce579f5f96f7d9008f72ab03eef4f1c6db609
# Parent  45c2debe0fc3d9632372a15826b1b64a35ff43c4
Fixed split after open bug (regression in 1.1.7).

--- PIL/Image.py
+++ PIL/Image.py
@@ -1494,11 +1494,11 @@ class Image:
     def split(self):
         "Split image into bands"
 
+        self.load()
         if self.im.bands == 1:
             ims = [self.copy()]
         else:
             ims = []
-            self.load()
             for i in range(self.im.bands):
                 ims.append(self._new(self.im.getband(i)))
         return tuple(ims)
