Latest LQ Deal: Latest LQ Deals
Go Back > Blogs > uxrs75
User Name


Rate this Entry

Viewing Images With Elinks

Posted 07-30-2010 at 01:33 PM by uxrs75

Programmes: elinks, fbida
Files to edit: ~/.elinks/elinks.conf

Start by installing a suitable image viewer. I use fbida, as it provides both a framebuffer-, and X-based image viewer (fbi and ida respectively).

Next, add some MIME types to elinks.conf.

set mime.extension.jpg="image/jpeg"
set mime.extension.jpeg="image/jpeg"
set mime.extension.png="image/png"
set mime.extension.gif="image/gif"
set mime.extension.bmp="image/bmp"
Now add the following handlers:

set mime.handler.image_viewer.unix.ask = 1
set mime.handler.image_viewer.unix-xwin.ask = 0
set mime.handler.image_viewer.unix.block = 1
set mime.handler.image_viewer.unix-xwin.block = 0 
set mime.handler.image_viewer.unix.program = "fbi %"
set mime.handler.image_viewer.unix-xwin.program = "ida %"
The unix entry defines elinks' behaviour in the console, while the unix-xwin entry defines its behaviour under X. 1 = yes, 0 = no. In the last two entries, elinks is being told to use fbi to display images in the console, and ida in X.

Lastly, the image types need to be associated with the image viewer. Be sure that you have one entry for each of the previously defined mime.extension entries from above.

set mime.type.image.jpg = "image_viewer"
set mime.type.image.jpeg = "image_viewer"
set mime.type.image.png = "image_viewer"
set mime.type.image.gif = "image_viewer"
set mime.type.image.bmp = "image_viewer"
Once done, save, exit, and start elinks. Find a page that you know has images and move the cursor to one. Hit Enter. If you're in X, ida will automatically display the image in a separate window. If you're in the console, fbi will open the image in the frame buffer. To exit fbi, hit q, and you're back in elinks.

Just a note, if you're running elinks under screen, you won't be able to display images using fbi, but aside from that, you'll be able to view any statically linked image on the internet. Enjoy.
Posted in how-to
Views 16254 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 03:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration