Code Monkey home page Code Monkey logo

Comments (9)

wustho avatar wustho commented on July 20, 2024 2

Hey there, sorry a lot going on. I think it will be supported in future, but not in short time...

from epy.

wustho avatar wustho commented on July 20, 2024 2

@SlidingHorn hold up, epy and https://github.com/wustho/epr already support image like you suggested, mate

As you can read in epr documentation https://github.com/wustho/epr#opening-an-image

from epy.

lxhom avatar lxhom commented on July 20, 2024 1

Hej, just a small thing that could be implemented pretty easily:
I use the terminal kitty, and I wrote a small patch which for open_media displays the images in the terminal:

def open_media(scr, name, bstr):
    sfx = os.path.splitext(name)[1]
    fd, path = tempfile.mkstemp(suffix=sfx)
    try:
        with os.fdopen(fd, "wb") as tmp:
            # tmp.write(epub.file.read(src))
            tmp.write(bstr)
        # run(VWR + " " + path, shell=True)
        subprocess.call(
+           "kitty +kitten icat --silent " + path,
            shell=True,
+ #          stdout=subprocess.DEVNULL,
+ #          stderr=subprocess.DEVNULL
        )
        k = scr.getch()
    finally:
        os.remove(path)
    return k

Works perfectly, you could add a --kitty option to enable this if you want to add it :)

from epy.

autoteelar avatar autoteelar commented on July 20, 2024

nice! i really like this program and its features ^~^ you did a great job on it

from epy.

wustho avatar wustho commented on July 20, 2024

Thanks, mate! Appreciate it. I actually tried to implement it then. Casually, by checking if my kitty terminal support displaying image. Indeed it display for a second, then flickered and the image is gone.

So I dont bother continue since I have other things going on. Maybe in future when someone else does PR or when I can commit again...

from epy.

autoteelar avatar autoteelar commented on July 20, 2024

Thanks, mate! Appreciate it. I actually tried to implement it then. Casually, by checking if my kitty terminal support displaying image. Indeed it display for a second, then flickered and the image is gone.

So I dont bother continue since I have other things going on. Maybe in future when someone else does PR or when I can commit again...

aw, thats really cool you got it working for even a second though! i do not have much coding knowledge at all, i should get into it more so i can help out in situations like these ;v; i hope the other things you are busyt with aswell goes well ^~^

from epy.

SlidingHorn avatar SlidingHorn commented on July 20, 2024

Thanks, mate! Appreciate it. I actually tried to implement it then. Casually, by checking if my kitty terminal support displaying image. Indeed it display for a second, then flickered and the image is gone.

So I dont bother continue since I have other things going on. Maybe in future when someone else does PR or when I can commit again...

If I could offer a suggestion:

Maybe instead of trying to render it inline within the terminal (e.g. via w3m or whatever other method), you could just have links as placeholders that will use xdg-open to open the image in the user's preferred image viewer.

Just a thought! I just installed epy earlier today, and I'm loving it so far.

from epy.

SlidingHorn avatar SlidingHorn commented on July 20, 2024

@SlidingHorn hold up, epy and https://github.com/wustho/epr already support image like you suggested, mate

As you can read in epr documentation https://github.com/wustho/epr#opening-an-image

I didn't know that! I'm golden then, lol

from epy.

autoteelar avatar autoteelar commented on July 20, 2024

from epy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.