Image Viewer Scripts

Introduction

This repository provides Ma_Sys.ma Image Viewer scripts. These are intended to supplement more heavyweight applications like eog(1) by quick but feature-reduced scripts.

The idea behind these scripts stems from having many scanned-in pages and the need for some specific functions combined with keyboard-driven usage. As a result, the first script plan_view.py is controlled entirely by keyboard and provides predefined zoom-levels (1:1, fit to window and fit to width) useful for viewing scanned pages.

As plan_view.py was found to be slightly incomplete and also slow especially wrt. zooming, an attempt to reconstruct most of the functionality using an existing image viewer feh was made. This is implemented in script ma_plan_view_feh which is the default “image viewer” on MDVL systems (cf. vifmrc from conf-cli(32)).

Ma_Sys.ma Plan View plan_view.py

plan_view.py is invoked taking as argument a single directory which is scanned for image files in a non-recursive manner. Afterwards, the first in list is displayed. Plan View can then be controlled by the following keybindings (copied from the help screen):

Keys Action
F1 Display this help
F2 Version information
F5, CTRL-R Reload current file
r Reload directory
F10, ESC, q, CTRL-W, ALT-F4 Exit
F11 Toggle fullscreen mode
Page Down Page down (next file if end of page reached)
Page Up Page up (previous file if begin of page reached)
Home Go to first file
End Go to last file
c Center, adjust image to fit page width
$ Zoom out until the whole image is visible
0 Restore original image size
o, g, d open, goto, change dir: change directory
CTRL-[SCROLL] Zoom
Space, l, Right Next file.
Backspace, h, Left Previous file.
p Display current filename.
n Note filename to planview_sel.txt
e Toggle honor exif information.
m Toggle maximized.
b Toggle dark background color.

An older version of plan_view.py can also be found on https://pastebin.com/BbRES3Ve.

Notable Features

Notable features include

OS Information

plan_view.py has only ever been tested on Linux systems. However, given that it is Python and GTK it may as well work on Windows, too.

Script mvsel

A common task when processing image files is to decide for some of the images to be further processed or deleted. To do this interactively, shortuct key [n] in Plan View can be used. Afterwards, script mvsel can process this file as follows:

mvsel dir
Moves all of the selected files to directory dir.
mvsel -d
Deletes all of the selected files.

Feh-based Image Viewing

As feh(1) is quite versatile, it seemed that most of plan_view.py’s features could be implemented by providing a suitable configuration file. The following Plan View features do not seem to be provided out-of-the box by feh:

feh can be extend by custom “actions” which allow these features to be added by means of a controlling shell script. As a result, script ma_plan_view_feh was created. It invokes feh and maps two actions to the specific functions described above.

Note, that the shell script itself does not implement Plan View-like keybindings. Instead, it relies on a separate configuration file (from package mdvl-conf-gui) for configuring the keyboard shortcuts.

Also, from plan_view.py to ma_plan_view_feh, the following differences may be observed:

Reduced Features

While most image viewing tasks can be solved by means of the scripts provided here, there are some special cases for which programs like eog are better:


Ma_Sys.ma Website 5 (1.0.2) – no Flash, no JavaScript, no Webfont, no Copy Protection, no Mobile First. No bullshit. No GUI needed. Works with any browser.

Created: 2020/12/18 22:59:34 | Revised: 2022/09/18 21:15:38 | Tags: mdvl, shell, script, linux, python, images, plan_view | Version: 1.0.0 | SRC (Pandoc MD) | GPL

Copyright (c) 2020 Ma_Sys.ma. For further info send an e-mail to Ma_Sys.ma@web.de.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.