Naheel-Azawy/stpv

Image preview not working

Closed this issue · 9 comments

Hey, I tried to set this program up to preview images with lf, but I only get the output of exiftools instead of the actual image.

So instead of a preview, I'd see:

ExifTool Version Number         : 12.16
File Name                       : waves.jpg
Directory                       : pic/backgrounds
File Size                       : 170 KiB
File Modification Date/Time     : 2021:01:22 21:01:46+01:00
File Access Date/Time           : 2021:03:07 22:49:19+01:00
File Inode Change Date/Time     : 2021:01:22 21:06:14+01:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : inches
X Resolution                    : 96
Y Resolution                    : 96
Image Width                     : 1920
Image Height                    : 1080
Encoding Process                : Progressive DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 1920x1080
Megapixels                      : 2.1

Not sure what to do here.

Well, nevermind. I checked the last commit which added some silent fallbacks, which made me realise that I needed to have chafa installed. Might be useful to list all the needed dependencies to make it work though, to prevent situations like this.

@Pomegranate123 I totally agree with you. It's also getting messier than I expected with tons of fallback dependencies. I will try to sort this out and hopefully make it clear once I have some time. Thank you for reporting and have a nice day!

Sqvid commented

Hi there. Thank you for developing this tool. I too am having this issue however installing chafa did not fix it for me. I have installed stpv and lf and have

set previewer stpv
set cleaner stpvimgclr
&stpvimg --listen $id

in my lfrc.

I have ueberzug, chafa, and exiftools installed. I am running Void Linux. Any help would be much appreciated. Thank you.

@Sqvid Thank you for your interest! I have just installed lf and set my lfrc exactly as you mentioned. It seems to be working fine on my arch machine. Not sure where to start. Maybe you're on wayland? Maybe something wrong with the terminal?
If non of that is correct, I'll try installing void and give it a try once I get some time

Sqvid commented

Indeed I am on Wayland! Is stpv not supported or is there just an extra step?

Edit: I see now that Überzug requires X11. My apologies for not realising this earlier. I would still have expected it to fall back to chafa though.

Yep, it's an uberzug requirement. I thought of finding alternatives for wayland and the only solution I see is using kitty terminal. There might be some other solutions but I'm not aware of any right now.
I still live in the x11 land. Wayland is a bit scary to me as most of my toys won't work. But I'm seriously considering to take that jump as soon as I get enough time and upgrade my weapons.
As of why it's not falling back to chafa, I don't know. I'll try to take a look this weekend maybe.

Sqvid commented

Understandable. Thank you for your time nevertheless. As it happens I am using kitty. Is there a quick hack I could put in place?

As of now, no I haven't added support for kitty yet. It has been in my mind for a while but I haven't had he chance to see how it works. Now that you're asking for it I will probably give it a higher priority.

@Sqvid I gave kitty a try but something is going wrong when run under a lf or others https://github.com/Naheel-Azawy/stpv/blob/master/stpvimg#L39. Will try to resolve it later.