vigra icon indicating copy to clipboard operation
vigra copied to clipboard

Python vigra: allow filenames or files in impex

Open bekaus opened this issue 13 years ago • 3 comments

The vigra numpy impex functions take filenames as parameters. Support "file or filename" to enable io for bytestreams.

bekaus avatar Feb 16 '12 10:02 bekaus

This may be impossible if the underlying libraries (libtiff etc.) don't support it. Which file types would you like to support?

ukoethe avatar Feb 16 '12 12:02 ukoethe

This is an interesting wish which came up before. Maybe it is related to issue #33 (tiled TIFF reading, but also ROI reading, 3D volume impex API etc.). We should list motivating use cases here I think.

hmeine avatar Feb 16 '12 13:02 hmeine

+1 for this old issue, at least for TIFF and JPEG. When reading tiles from a remote server, it is nice to open in-memory image files without writing them to the hard disk first. For example, the Python requests library docs provide an example of how to do this using PIL:

>>> import requests
>>> r = requests.get('http://ukoethe.github.io/vigra/vigra_logo.gif')
>>> from PIL import Image
>>> from StringIO import StringIO
>>> i = Image.open(StringIO(r.content))

... on the other hand, I'm using PIL for now, and it seems to work just fine for my needs.

stuarteberg avatar Aug 11 '14 12:08 stuarteberg