lf icon indicating copy to clipboard operation
lf copied to clipboard

Ueberzug image previews overflow if drawbox option is set

Open noib3 opened this issue 4 years ago • 4 comments

When using ueberzug image previews as described in the wiki, the drawbox option isn't taken into account and some previews overflow into the border. I would post a screenshot but for some reason import doesn't work when trying to capture lf, I just get a black blob.

noib3 avatar Apr 04 '21 18:04 noib3

I've had that problem in the past but it seems to have been resolved at some point. I've compiled lf from source ca. a week ago and it has been working ever since.

image

What doesn't work is that when toggling borders the preview is not generated anew, causing ueberzug previews to be off.

demo

slavistan avatar Apr 24 '21 11:04 slavistan

@slavistan You seem right. I thought we explicitly need to handle this while exporting coordinate variables but there is no need for that since window coordinates already take drawbox option into account.

I have now pushed a fix to flush the cache and renew the preview with drawbox option changes. I don't think there is anything else left for this issue.

gokcehan avatar Apr 25 '21 13:04 gokcehan

Hello @gokcehan ,

This issue persists when I preview images using the icat of kitty terminal. The config I followed is in Wiki

My lf version is the latest (i.e., built from source).

image

Thank you.

Update: if subtract 1 from the width, the image size will be correct.

#!/usr/bin/env bash

file=$1
w=`expr $2 - 1`
h=$3
x=$4
y=$5

case "$file" in
  *.bmp|*.jpg|*.jpeg|*.png|*.xpm) kitty +icat --silent --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" && exit 1;;
esac

rockyzhang24 avatar Mar 03 '22 23:03 rockyzhang24

I'm having this issue as well, most noticeably on Konsole and Tilix (tilix has images outside the terminal entirely). However for me, at least in Konsole, it happens regardless of drawboxes being present or not. I am using ueberzug previews.

image

image

ItsRogueRen avatar Apr 10 '22 19:04 ItsRogueRen