Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Read image from stdin #250

Closed
wavexx opened this issue Oct 15, 2016 · 8 comments
Closed

Read image from stdin #250

wavexx opened this issue Oct 15, 2016 · 8 comments

Comments

@wavexx
Copy link

wavexx commented Oct 15, 2016

It would be nice if I could display an image directly supplied via stdin:

... | sxiv -

but it currently expects to read a file list, even though -i has not been specified.

@ropery
Copy link

ropery commented Oct 15, 2016

See #242 (rejected PR).
#242 uses a temporary file, which indeed is easy to do with a shell wrapper.

@wavexx
Copy link
Author

wavexx commented Oct 15, 2016

On Sat, Oct 15 2016, .)(. wrote:

See #242 (rejected PR).
#242 uses a temporary file, which indeed is easy to do with a shell wrapper.

I'm already using the <() syntax for this even without a shell wrapper,
but I wanted to avoid the temporary file in the first place.

I see the proposed patch simply converted the stream into a temporary
file, which is no better.

Why not pass directly the stdin descriptor to the image decoding
routines?

@ropery
Copy link

ropery commented Oct 15, 2016

I'm already using the <() syntax for this even without a shell wrapper,

That works for you? Mind sharing an example?

@wavexx
Copy link
Author

wavexx commented Oct 15, 2016

On Sat, Oct 15 2016, .)(. wrote:

I'm already using the <() syntax for this even without a shell wrapper,
That works for you? Mind sharing an example?

Sorry, <() also doesn't work for me. I meant =() (which does proc
substitution through temporary files on zsh).

@ropery
Copy link

ropery commented Oct 15, 2016

Ah I see, still a nice trick, thank you.

@xyb3rt
Copy link
Owner

xyb3rt commented Oct 16, 2016

sxiv needs to use a temporary file for this, because imlib2 is not able to load an image from memory.

@jluttine
Copy link

Sorry for bumping an old issue, but apparently imlib2 has now added support for loading images from memory. Not yet released though, but in current development branch. At least if we understood each other correctly in my upstream feature request: https://phab.enlightenment.org/T8726. (I'm not too familiar with sxiv nor imlib2, so I might have misunderstood or misexplained something.)

@jluttine
Copy link

jluttine commented Dec 6, 2020

imlib2 version 1.7.0 has now support for reading images from memory: imlib_load_image_from_fd()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants