{"action":"created","issue":{"url":"https://api.github.com/repos/soft-matter/pims/issues/134","labels_url":"https://api.github.com/repos/soft-matter/pims/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/soft-matter/pims/issues/134/comments","events_url":"https://api.github.com/repos/soft-matter/pims/issues/134/events","html_url":"https://github.com/soft-matter/pims/issues/134","id":55626180,"number":134,"title":"TiffStack fails on IndexError from Tifffile","user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-27T14:45:33Z","updated_at":"2015-01-27T15:40:47Z","closed_at":null,"body":"Reported to me via email:\r\n\r\n    >>> v=pims.TiffStack(f)\r\n    Traceback (most recent call last):\r\n      File \"<stdin>\", line 1, in <module>\r\n      File \"/home/christopher/.virtualenvs/wormvision3/lib/python3.4/site-packages/pims/tiff_stack.py\", line 322, in __init__\r\n        self.im.seek(j)\r\n      File \"/usr/lib/python3/dist-packages/PIL/TiffImagePlugin.py\", line 626, in seek\r\n        self._seek(frame)\r\n      File \"/usr/lib/python3/dist-packages/PIL/TiffImagePlugin.py\", line 644, in _seek\r\n        self.tag.load(self.fp)\r\n      File \"/usr/lib/python3/dist-packages/PIL/TiffImagePlugin.py\", line 417, in load\r\n        for i in range(i16(fp.read(2))):\r\n      File \"/usr/lib/python3/dist-packages/PIL/_binary.py\", line 35, in i16be\r\n        return (i8(c[o])<<8) | i8(c[o+1])\r\n    IndexError: index out of range\r\n\r\nI usually pass a file name, not file object, to `TiffStack` but file objects work fine too:\r\n\r\n    In [2]: f = open('stuck.tif', 'r')\r\n\r\n    In [3]: pims.TiffStack(f)\r\n    Out[3]: \r\n    <Frames>\r\n    Source: <open file 'stuck.tif', mode 'r' at 0x105d95810>\r\n    Length: 5 frames\r\n    Frame Shape: 512 x 512\r\n    Pixel Datatype: <type 'numpy.uint16'>\r\n\r\nIt looks like this issue goes down all the way to tifffile. I'm not sure we can do anything except maybe fail more informatively."},"comment":{"url":"https://api.github.com/repos/soft-matter/pims/issues/comments/71668595","html_url":"https://github.com/soft-matter/pims/issues/134#issuecomment-71668595","issue_url":"https://api.github.com/repos/soft-matter/pims/issues/134","id":71668595,"user":{"login":"22csnyder","id":10726729,"avatar_url":"https://avatars.githubusercontent.com/u/10726729?v=3","gravatar_id":"","url":"https://api.github.com/users/22csnyder","html_url":"https://github.com/22csnyder","followers_url":"https://api.github.com/users/22csnyder/followers","following_url":"https://api.github.com/users/22csnyder/following{/other_user}","gists_url":"https://api.github.com/users/22csnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/22csnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/22csnyder/subscriptions","organizations_url":"https://api.github.com/users/22csnyder/orgs","repos_url":"https://api.github.com/users/22csnyder/repos","events_url":"https://api.github.com/users/22csnyder/events{/privacy}","received_events_url":"https://api.github.com/users/22csnyder/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T15:40:47Z","updated_at":"2015-01-27T15:40:47Z","body":"Hi I sent Daniel that error message,\r\n\r\nLooking more closely: it doesn't seem to have to do with Python version as much as the file. I am though for the record in 64bit Python3.4. The file [attached] opens fine in ImageJ, but fails with v=pims.TiffStack('mypath'). pims.TiffStack('a_different_tiffstack') does manage to load with PIMS. Attached is the offending file.\r\n...\r\nWait how can I send you the file if it's 400MB?\r\n-Chris"}}