Added return for J2k (and fpx) Load to return a pixel access object

This commit is contained in:
wiredfool 2016-08-08 07:36:34 -07:00
parent 37841dbaeb
commit cf27e03dcd
3 changed files with 4 additions and 3 deletions

View File

@ -216,7 +216,7 @@ class FpxImageFile(ImageFile.ImageFile):
self.fp = self.ole.openstream(self.stream[:2] +
["Subimage 0000 Data"])
ImageFile.ImageFile.load(self)
return ImageFile.ImageFile.load(self)
#
# --------------------------------------------------------------------

View File

@ -207,7 +207,7 @@ class Jpeg2KImageFile(ImageFile.ImageFile):
t3 = (t[3][0], self.reduce, self.layers, t[3][3], t[3][4])
self.tile = [(t[0], (0, 0) + self.size, t[2], t3)]
ImageFile.ImageFile.load(self)
return ImageFile.ImageFile.load(self)
def _accept(prefix):

View File

@ -34,7 +34,8 @@ class TestFileJpeg2k(PillowTestCase):
self.assertRegexpMatches(Image.core.jp2klib_version, '\d+\.\d+\.\d+$')
im = Image.open('Tests/images/test-card-lossless.jp2')
im.load()
px = im.load()
self.assertTrue(px)
self.assertEqual(im.mode, 'RGB')
self.assertEqual(im.size, (640, 480))
self.assertEqual(im.format, 'JPEG2000')