Christopher Brooks wrote: > I've been using PIL a fair bit lately and am really liking it - it's great > to have such a library available. The docs suggest that im.load() should > return a pixel access object, but this doesn't actually seem to always work. > Sometimes I get the object, sometimes I get a None back. > > In particular, it seems when I take an image, run a crop() on it, then a > load() on it, I'll tend to get the None back. I can probably drum up an > example of this if it is useful, but I'm wondering if there are any caveats > of the load() method that are not listed in the docs?
it's a known bug in the "lazy crop" class. here's a patch: Index: PIL/Image.py =================================================================== --- PIL/Image.py (revision 3324) +++ PIL/Image.py (revision 3325) @@ -1645,6 +1645,9 @@ self.im = self.im.crop(self.__crop) self.__crop = None + if self.im: + return self.im.pixel_access(self.readonly) + # FIXME: future versions should optimize crop/paste # sequences! </F> _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig