blessed icon indicating copy to clipboard operation
blessed copied to clipboard

Can't figure out how to render an image.

Open gesem49 opened this issue 4 years ago • 1 comments

Can't really load a simple PNG. What I've done so far: Used image, ANSIImage and OverlayImage with the options specified in the readme. Ended up almost copy-pasting this code: // Add a png icon to the box var icon = blessed.image({ parent: screen, top: 0, left: 0, type: 'overlay', width: 'shrink', height: 'shrink', file: path.join(__dirname, 'testimg.png'), search: true }); screen.append(icon) screen.render();

And it does not work. Just renders a black window. It takes some time to load, so I'm figuring out that maybe it is working for something like a library (like w3m). I'm new to Ubuntu, so maybe there is something related to dependencies? No errors are being throwed. I've installed w3m and w3m-img package. The Blessed documentations says something about "w3mimagedisplay"...

I'm frankly lost. Help will be appreciated, since I didn't found any image rendering working examples.

gesem49 avatar Sep 03 '19 23:09 gesem49

Did you checked the example https://github.com/chjj/blessed/blob/master/test/widget-image.js I never done it but I think you need to have accessible vendor/tng.js and widget-png.js like in https://github.com/chjj/blessed/search?q=png&unscoped_q=png Good look, could you please share the code if success so I add the example to my own not-a-fork-just-high-level-layer-on-top-of-blessed project https://github.com/cancerberoSgx/accursed Thanks

cancerberoSgx avatar Sep 12 '19 22:09 cancerberoSgx