{"action":"created","issue":{"url":"https://api.github.com/repos/kif/fabio/issues/44","labels_url":"https://api.github.com/repos/kif/fabio/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/kif/fabio/issues/44/comments","events_url":"https://api.github.com/repos/kif/fabio/issues/44/events","html_url":"https://github.com/kif/fabio/issues/44","id":119808288,"number":44,"title":"Error while trying to open image. tostring() has been removed.","user":{"login":"hhslepicka","id":8185425,"avatar_url":"https://avatars.githubusercontent.com/u/8185425?v=3","gravatar_id":"","url":"https://api.github.com/users/hhslepicka","html_url":"https://github.com/hhslepicka","followers_url":"https://api.github.com/users/hhslepicka/followers","following_url":"https://api.github.com/users/hhslepicka/following{/other_user}","gists_url":"https://api.github.com/users/hhslepicka/gists{/gist_id}","starred_url":"https://api.github.com/users/hhslepicka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhslepicka/subscriptions","organizations_url":"https://api.github.com/users/hhslepicka/orgs","repos_url":"https://api.github.com/users/hhslepicka/repos","events_url":"https://api.github.com/users/hhslepicka/events{/privacy}","received_events_url":"https://api.github.com/users/hhslepicka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-01T21:08:06Z","updated_at":"2015-12-02T15:32:03Z","closed_at":null,"body":"Hi,\r\nI installed the latest version of FabIO from github master and the tests passed.\r\nThe issue is that I'm trying to use FabIO to open a TIFF image but the following error is shown:\r\n\r\n```python\r\nIn [1]: import fabio\r\n\r\nIn [2]: fabio.open(\"Feb09-bright-00.300s_WAXS\")\r\n\r\nWARNING:tifimage:Unable to read Feb09-bright-00.300s_WAXS with TiffIO due to could not broadcast input array from shape (521,1042) into shape (1042,1042), trying PIL\r\n---------------------------------------------------------------------------\r\nException                                 Traceback (most recent call last)\r\n<ipython-input-2-ce38474c489e> in <module>()\r\n----> 1 fabio.open(\"Feb09-bright-00.300s_WAXS\")\r\n\r\n/Users/hugoslepicka/anaconda/envs/pyXS/lib/python3.4/site-packages/fabio-0.3.0b3-py3.4-macosx-10.5-x86_64.egg/fabio/openimage.py in openimage(filename, frame)\r\n    144         obj = _openimage(filename)\r\n    145         logger.debug(\"Attempting to read frame %s from %s\" % (frame, filename))\r\n--> 146         obj = obj.read(obj.filename, frame)\r\n    147     return obj\r\n    148\r\n\r\n/Users/hugoslepicka/anaconda/envs/pyXS/lib/python3.4/site-packages/fabio-0.3.0b3-py3.4-macosx-10.5-x86_64.egg/fabio/tifimage.py in read(self, fname, frame)\r\n    188                         self.data = numpy.fromstring(self.pilimage.tostring(), PIL_TO_NUMPY[self.pilimage.mode])\r\n    189                     else:  # probably RGB or RGBA images: rely on PIL to convert it to greyscale float.\r\n--> 190                         self.data = numpy.fromstring(self.pilimage.convert(\"F\").tostring(), numpy.float32)\r\n    191                     self.data.shape = (self.dim2, self.dim1)\r\n    192             else:\r\n\r\n/Users/hugoslepicka/anaconda/envs/pyXS/lib/python3.4/site-packages/PIL/Image.py in tostring(self, *args, **kw)\r\n    684     def tostring(self, *args, **kw):\r\n    685         raise Exception(\"tostring() has been removed. \" +\r\n--> 686                         \"Please call tobytes() instead.\")\r\n    687\r\n    688     def tobitmap(self, name=\"image\"):\r\n\r\nException: tostring() has been removed. Please call tobytes() instead.\r\n```\r\n\r\nI can open the image with the following code:\r\n\r\n```python\r\n\r\n\r\nIn [1]: from PIL import Image\r\n\r\nIn [2]: im = Image.open(\"Feb09-bright-00.300s_WAXS\")\r\n\r\nIn [3]: import numpy as np\r\n\r\nIn [4]: import matplotlib.pyplot as plt\r\n\r\nIn [5]: data = np.asarray(im).copy()\r\n\r\nIn [6]: plt.imshow(data)\r\n\r\nIn [7]: plt.show()\r\n```\r\n\r\n\r\nPackages installed:\r\n===============\r\npython                    3.4.3\r\nfabio                     0.3.0b3\r\npillow                    3.0.0\r\n\r\n\r\nThanks,\r\nHugo"},"comment":{"url":"https://api.github.com/repos/kif/fabio/issues/comments/161333980","html_url":"https://github.com/kif/fabio/issues/44#issuecomment-161333980","issue_url":"https://api.github.com/repos/kif/fabio/issues/44","id":161333980,"user":{"login":"hhslepicka","id":8185425,"avatar_url":"https://avatars.githubusercontent.com/u/8185425?v=3","gravatar_id":"","url":"https://api.github.com/users/hhslepicka","html_url":"https://github.com/hhslepicka","followers_url":"https://api.github.com/users/hhslepicka/followers","following_url":"https://api.github.com/users/hhslepicka/following{/other_user}","gists_url":"https://api.github.com/users/hhslepicka/gists{/gist_id}","starred_url":"https://api.github.com/users/hhslepicka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhslepicka/subscriptions","organizations_url":"https://api.github.com/users/hhslepicka/orgs","repos_url":"https://api.github.com/users/hhslepicka/repos","events_url":"https://api.github.com/users/hhslepicka/events{/privacy}","received_events_url":"https://api.github.com/users/hhslepicka/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T15:32:03Z","updated_at":"2015-12-02T15:32:03Z","body":"Hi Jérôme,\r\nSure, please download the image from the following link:\r\nhttps://www.dropbox.com/s/toi5z2rknsx5qof/Feb09-bright-00.300s_WAXS?dl=0"}}