Skip to content

Commit

Permalink
Merge pull request #2061 from wiredfool/j2k-access
Browse files Browse the repository at this point in the history
Added return for J2k (and fpx) Load to return a pixel access object
  • Loading branch information
wiredfool committed Aug 25, 2016
2 parents 581014e + 2120976 commit 0444b49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PIL/FpxImagePlugin.py
Expand Up @@ -216,7 +216,7 @@ def load(self):
self.fp = self.ole.openstream(self.stream[:2] +
["Subimage 0000 Data"])

ImageFile.ImageFile.load(self)
return ImageFile.ImageFile.load(self)

#
# --------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion PIL/Jpeg2KImagePlugin.py
Expand Up @@ -207,7 +207,7 @@ def load(self):
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):
Expand Down
3 changes: 2 additions & 1 deletion Tests/test_file_jpeg2k.py
Expand Up @@ -34,7 +34,8 @@ def test_sanity(self):
self.assertRegexpMatches(Image.core.jp2klib_version, '\d+\.\d+\.\d+$')

im = Image.open('Tests/images/test-card-lossless.jp2')
im.load()
px = im.load()
self.assertEqual(px[0,0], (0, 0, 0))
self.assertEqual(im.mode, 'RGB')
self.assertEqual(im.size, (640, 480))
self.assertEqual(im.format, 'JPEG2000')
Expand Down

0 comments on commit 0444b49

Please sign in to comment.