{"action":"created","issue":{"url":"https://api.github.com/repos/freeman-lab/thunder/issues/82","labels_url":"https://api.github.com/repos/freeman-lab/thunder/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/freeman-lab/thunder/issues/82/comments","events_url":"https://api.github.com/repos/freeman-lab/thunder/issues/82/events","html_url":"https://github.com/freeman-lab/thunder/pull/82","id":54367674,"number":82,"title":"add back pil_to_array function for use with old versions of PIL","user":{"login":"industrial-sloth","id":8592708,"avatar_url":"https://avatars.githubusercontent.com/u/8592708?v=3","gravatar_id":"","url":"https://api.github.com/users/industrial-sloth","html_url":"https://github.com/industrial-sloth","followers_url":"https://api.github.com/users/industrial-sloth/followers","following_url":"https://api.github.com/users/industrial-sloth/following{/other_user}","gists_url":"https://api.github.com/users/industrial-sloth/gists{/gist_id}","starred_url":"https://api.github.com/users/industrial-sloth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/industrial-sloth/subscriptions","organizations_url":"https://api.github.com/users/industrial-sloth/orgs","repos_url":"https://api.github.com/users/industrial-sloth/repos","events_url":"https://api.github.com/users/industrial-sloth/events{/privacy}","received_events_url":"https://api.github.com/users/industrial-sloth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-14T19:50:39Z","updated_at":"2015-01-19T05:27:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/freeman-lab/thunder/pulls/82","html_url":"https://github.com/freeman-lab/thunder/pull/82","diff_url":"https://github.com/freeman-lab/thunder/pull/82.diff","patch_url":"https://github.com/freeman-lab/thunder/pull/82.patch"},"body":"Old PIL does not load images correctly in Spark using the new-style `array(pilimg)` syntax, however the new pillow module appears to handle this correctly. Here fall back to matplotlib's old `pil_to_array` conversion if we detect that we've got PIL but not pillow installed.\r\n\r\nWithout this PR, loading tifs (at least single-page tifs, possibly others) with PIL 1.1.7 leads to results like the following:\r\n```python\r\nIn [15]: data = tsc.loadImages('/path/to/tifs/', inputformat='tif-stack')\r\nIn [16]: data.first()[1].shape\r\nOut[16]: (1, 1, 1)\r\nIn [17]: data.first()[1]\r\nOut[17]: array([[[ <PIL.TiffImagePlugin.TiffImageFile image mode=I;16 size=512x512 at 0x3B02B00>]]], dtype=object)\r\n```"},"comment":{"url":"https://api.github.com/repos/freeman-lab/thunder/issues/comments/70447898","html_url":"https://github.com/freeman-lab/thunder/pull/82#issuecomment-70447898","issue_url":"https://api.github.com/repos/freeman-lab/thunder/issues/82","id":70447898,"user":{"login":"freeman-lab","id":3387500,"avatar_url":"https://avatars.githubusercontent.com/u/3387500?v=3","gravatar_id":"","url":"https://api.github.com/users/freeman-lab","html_url":"https://github.com/freeman-lab","followers_url":"https://api.github.com/users/freeman-lab/followers","following_url":"https://api.github.com/users/freeman-lab/following{/other_user}","gists_url":"https://api.github.com/users/freeman-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/freeman-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeman-lab/subscriptions","organizations_url":"https://api.github.com/users/freeman-lab/orgs","repos_url":"https://api.github.com/users/freeman-lab/repos","events_url":"https://api.github.com/users/freeman-lab/events{/privacy}","received_events_url":"https://api.github.com/users/freeman-lab/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T05:27:00Z","updated_at":"2015-01-19T05:27:00Z","body":"LGTM, thanks @industrial-sloth . Eventually it'd be best to eliminate our dependence on PIL/pillow entirely, but for now this is what we have to do."}}