gokcehan/lf

Screen tearing while previewing a pdf file

Closed this issue · 3 comments

Hi!

I've encountered screen tearing in lf while previewing a pdf file. This
happens around 80% of time while trying to preview the file.

Asciinema cast
Video

In the video, it happens while renaming, however, on some invocations
it happens just on previewing the file

Error messages:

Syntax Warning: Illegal entry in bfchar block in ToUnicode CMap
                                                                                                                              Syntax Warning: Illegal entry in bfchar block in ToUnicode CMap
<...>

While previewing the file directly with chafa -f sixel file.pdf it yields
the correct result (however, a message is printed to stderr):

**** Error: Form stream has unbalanced q/Q operators (too many q's)
               Output may be incorrect.

I'm not sure the issue is in lf itself. I've encountered
another issue with chafa
so it may be related.

Unfortunately, I can't attach the file here as it contains sensitive
information. Send me a message at to@myrrc.dev and I'll reply with the file
attached.

lf version: r31
lf config

ctpv version: v1.1
ctpv config

chafa version: 1.8.0

terminal: foot version: 1.11.0 -pgo +ime -graphemes -assertions

~ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"

Those look a lot like errors from ImageMagick's PDF loader backend. Chafa used IM as a fallback loader up until version 1.14.0, where it was discontinued. Calling Chafa with --animate off (available in Chafa 1.10.0 or newer) may also help in previewers.

I took a look at the test files (thanks @myrrc!) Was able to confirm that the warnings come from ImageMagick. You should see the same warnings using convert foo.pdf foo.gif. This will also render multipage PDFs as animated GIFs.

Closing issue, not lf related. Thanks