From: "Aleksander Gorohovski" <angel@feht.dgtu.donetsk.ua>
To: "ALT Linux Community general discussions" <community@lists.altlinux.org>
Subject: Re: [Comm] djvu
Date: Mon, 03 Nov 2008 20:59:03 +0200
Message-ID: <op.uj14cpavy60z1c@oc.peooc.net> (raw)
In-Reply-To: <490F4252.5030907@gmail.com>
On Mon, 03 Nov 2008 20:26:26 +0200, Alexey Borisenkov
<grizlik78@gmail.com> wrote:
> Ivan Petrov пишет:
>> А чем делают сабж в Альте?
>> Я посмотрел в /usr/bin утилиты - все или просмотр или преобразование.
>> А чем колдируют в этот формат?
>
> cjb2, c44, djvm и ещё множество утилит из набора djvu-utils
> man djvu
> возможно есть что-то графическое, но мне и этих вполне хватает.
Я пользуюсь скриптом
#!/bin/bash
#
# any2djvu-bw
#
if [ -z `which anytopnm` -o -z `which ppmtopgm` -o -z `which pgmtopbm` -o
-z `which cjb2` ]; then
usage
echo "Error: anytopnm, ppmtopgm, pgmtopbm and cjb2 are needed"
echo
exit 1
fi
shopt -s extglob
DEFMASK="*.jpg"
#DEFMASK="*.png"
DPI=300
# uncomment the following line to compile a bundled DjVu document
OUTFILE="#0-bw.djvu"
function usage() {
echo
echo "usage:"
echo
echo "$0 [\"REGEXP\"]"
echo " converts single pages with the default mask $DEFMASK (or REGEXP if
provided)"
echo " in the current directory to single-page black and white djvu
documents"
# uncomment the following line to compile a bundled DjVu document
echo " and bundles them as a djvu file $OUTFILE"
echo
}
if [ -n "$1" ]; then
MASK=$1
else
MASK=$DEFMASK
fi
for i in $MASK; do
if [ ! -e $i ]; then
usage
echo "Error: current directory must contain files with the mask $MASK"
echo
exit 1
fi
if [ ! -e $i.djvu ]; then
echo "$i"
anytopnm $i | ppmtopgm | pgmtopbm -value 0.499 > $i.pbm
# in netpbm >= 10.23 the above line can be replaced with the following:
# anytopnm $i | ppmtopgm | pamditherbw -value 0.499 > $.pbm
cjb2 -dpi $DPI $i.pbm $i.djvu
rm -f $i.pbm
fi
done
# uncomment the following line to compile a bundled DjVu document
djvm -c $OUTFILE $MASK.djvu
next prev parent reply other threads:[~2008-11-03 18:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 18:14 Ivan Petrov
2008-11-03 18:26 ` Alexey Borisenkov
2008-11-03 18:59 ` Aleksander Gorohovski [this message]
2008-11-04 4:14 ` Ivan Petrov
2008-11-04 4:18 ` Ivan Petrov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.uj14cpavy60z1c@oc.peooc.net \
--to=angel@feht.dgtu.donetsk.ua \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git