Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DjVu support would be very desirable... #20

Open
tigran123 opened this issue Sep 28, 2018 · 0 comments
Open

DjVu support would be very desirable... #20

tigran123 opened this issue Sep 28, 2018 · 0 comments

Comments

@tigran123
Copy link

My current workaround for viewing djvu files on the fb console looks like this:

#!/bin/bash

#
# fbdjview --- View DjVu files on Linux framebuffer console
# By Tigran Aivazian, v1.0, 29 December 2017
# License: GPLv3
#
# Pre-requisites:  fbi and ddjvu (Run "sudo apt install fbi djvulibre-bin" to install on Ubuntu)
#

if [ $# -ne 1 ] ; then
    echo "Usage: fbdjview file.djvu"
    exit 1
fi

if [ ! -f "$1" ] ; then
    echo "fbdjview: No such file \"$1\""
    exit 2
fi

md5=$(md5sum "$1" | cut -d' ' -f1)

cachedir=~/.cache/fbdjview/$md5

function cleanup() {
   echo "Cleaning up $cachedir"
   rm -rf $cachedir
   exit
}

trap cleanup SIGINT

if [ ! -d $cachedir ] ; then
    mkdir -p $cachedir
    echo -n "Please wait, generating cache in $cachedir ..."
    ddjvu -eachpage -scale=150 -format=tiff "$1" $cachedir/page%04d.tif || cleanup
fi

fbi -a $cachedir/page*.tif

The obvious drawback is that it needs to generate the cache for the first viewing of any file and that it uses up disk space for this cache. So, it would be very nice if jfbview supported djvu format natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant