i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
921 stars 404 forks source link

OOM when piped valid PNG #227

Closed owenthewizard closed 4 years ago

owenthewizard commented 5 years ago

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Other (Please describe in detail)

Current Behavior

import -window root /tmp/i3lock.png # take screenshot with ImageMagick
convert /tmp/i3lock.png -blur 10 - | i3lock -i /dev/stdin # blur with ImageMagick and pipe to i3lock
cat /tmp/i3lock.png | i3lock -i /dev/stdin # this also doesn't work
i3lock -i /dev/stdin < /tmp/i3lock.png # this does

Output:

Could not load image "/dev/stdin": out of memory

Expected Behavior

i3lock should use the PNG as a background.

Reproduction Instructions

See "Current Behavior" above.

Environment

Output of i3lock --version:

i3lock: version 2.11.1 © 2010 Michael Stapelberg
owenthewizard commented 5 years ago

Any update on this?

eplanet commented 5 years ago

Hello! I wouldn't be surprised that i3lock doesn't support /dev/stdin fd. I suppose the workaround of storing convert result to a temporary file works?

convert /tmp/i3lock.png -blur 10 - > /tmp/i3lock_blurred.png
i3lock -i /tmp/i3lock_blurred.png
owenthewizard commented 5 years ago

It supports it when redirected, but not when piped. In my use case I want to avoid using a temporary file.

owenthewizard commented 5 years ago

Another working method:

i3lock -i /dev/stdin < <(cat ~/Pictures/GIMP_Pepper.png)

Replace cat with any command, e.g. ImageMagick.

owenthewizard commented 5 years ago

Hmm, piping seems to work using raw images --raw=WxH:fmt.

stapelberg commented 4 years ago

Closing this as piping seems to work with raw images.