wustho / baca

TUI Ebook Reader
GNU General Public License v3.0
363 stars 4 forks source link

[Feature] More Image options +[Bug] #19

Open Disonantemus opened 9 months ago

Disonantemus commented 9 months ago

More Image options

Right now I think baca do a nice job to show images as ANSI colored blocks, but can be better to have more external options (that should be easy to do). I think is good idea to show images as it's now, but have an option that shows a place holder with the image filename (Example: [cover.jpg]) and offer a hotkey to open outside (external). Options:


I think nnn do this very well with plugins like: preview-tui-ext, preview-tabbed, nuke, imgview; should be useful because the code is easy to read (I'm no programmer). There is a happy coincidence with gutenread plugin, that uses epr to read from Project Gutemberg.

Maybe this can help you to add some more image options. Can be as simple as custom command, to use a preferred external iamge viewer. Or more complex, like showing image in a new "window pane" or tab (inside a multiplexer).


[Bug]

I did notice that front cover image (cover.jpg) was not shown in my tests, I did test with same e-book in epub and azw3 formats. Later I did try with two more epubs, and happens the same, it did skip 1st image (cover).

wustho commented 9 months ago

Right now I think baca do a nice job to show images as ANSI colored blocks, but can be better to have more external options (that should be easy to do). I think is good idea to show images as it's now, but have an option that shows a place holder with the image filename (Example: [cover.jpg]) and offer a hotkey to open outside (external).

Actually there is configuration for that, here is the part of the doc: https://github.com/wustho/baca#opening-an-image

Bug

Hmm, I thought I encountered that issue before, but I brushed it off since the feature of showing the cover isn't worth the effort. Will look into it again... thanks for confirming

Disonantemus commented 9 months ago
  1. Your right, sorry, I did missed this. Because it's not obvious, I changed PreferredImageViewer = auto to all my installed image viewers (nsxiv, imv, viu {inside virtual terminal}, feh, imagemagick's display), and works with no problem inside X11. Example (config.ini):
    PreferredImageViewer = nsxiv

    This is very helpful, because some e-books can have useful detailed information 4 the reader as drawings, like:

    • maps
    • family trees
    • more: people, places, puzzles

Examples:


  1. When using baca from TTY, there's no mouse to click image and launch the custom image viewer. Because of this, I wasn't able to test TTY|Framebuffer viewers. Would help to have a hotkey (like "v" or something else), to launch the 1st image (or placeholder) displayed in the actual e-book page, and/or there is a way using gpm to use a real mouse in TTY.

  1. When changing config.ini to:
    ShowImageAsANSII = No

    I get the image placeholder, but should be better have the filename, because sometimes is a descriptive name, like cover123.jpg

    ┌────────────────────────────────────┐
    │IMAGE                               │
    └────────────────────────────────────┘

    Something like this (Mockup):

    ┌────────────────────────────────────┐
    │IMAGE: cover123.jpg                 │
    └────────────────────────────────────┘
ErtaiBlue commented 1 month ago

It would be nice if images would be shown using the sixel protocol for terminals that support it, kitty protocol for the kitty terminal, or using ueberzugg.