i3 / i3lock

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

Setting the background to a 16bpc PNG image doesn't work #297

Closed SapuSeven closed 3 years ago

SapuSeven commented 3 years ago

I'm submitting a…

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

Current Behavior

Setting the background image to a 16bpc PNG doesn't show the image.

Expected Behavior

Correctly show 16 bit per channel PNG background images.

Reproduction Instructions

Export any PNG image (e.g. GIMP) with 16bpc RGB color depth (here img.png) Running the file command will show something like the following:

img.png: PNG image data, 1920 x 1080, 16-bit/color RGB, non-interlaced

Now run i3lock with the -i flag:

i3lock -i img.png

i3lock shows a blank white screen instead of the image.

The same scenario with an 8 bit PNG works as intended.

Environment

Output of i3lock --version:

i3lock version: 2.13
stapelberg commented 3 years ago

My first guess is that this might be a cairo bug/limitation instead, unless there’s any evidence that i3lock is using cairo wrong to load images…?

SirWrexes commented 3 years ago

This is a duplicate of #244 and it's a Cairo bug. If you're using convert to process your image before sending it to i3lock, you could add -depth 8 to your options as a temporary workaround.

SapuSeven commented 3 years ago

You're right. Thanks!