Your message dated Sat, 14 Apr 2018 21:05:15 +0000
with message-id <e1f7smf-000fjq...@fasolo.debian.org>
and subject line Bug#895651: fixed in djvubind 1.2.1-4
has caused the Debian Bug report #895651,
regarding djvubind dies when trying to encode "mixed mode images" from 
scantailor
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
895651: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895651
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: djvubind
Version: 1.2.1-3
Severity: important

Hi, Clint.

When trying to create a book with some tiff files that were (very
laboriously) generated by scantailor (with lots of fine-tuning by hand), I
get the following, very non-informative stack trace from djvubind, when I
have files that are "mixed mode":

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(...)
msg: s-260_1L.tif: Bitonal image but with a depth greater than 1.  Modifying 
image depth.
msg: s-260_2R.tif: Bitonal image but with a depth greater than 1.  Modifying 
image depth.
* Performing optical character recognition.
  OCR is disabled and will be skipped.
* Encoding all information to /tmp/solutions/out/book.djvu.
Traceback (most recent call last):
  File "/usr/bin/djvubind", line 446, in <module>
    proj.bind()
  File "/usr/bin/djvubind", line 171, in bind
    self.enc.enc_book(self.book, self.out)
  File "/usr/lib/python3/dist-packages/djvubind/encode.py", line 281, in 
enc_book
    self._csepdjvu(page.path, tempfile, page.dpi)
  File "/usr/lib/python3/dist-packages/djvubind/encode.py", line 137, in 
_csepdjvu
    self._cjb2('temp_textual.tif', 'enc_bitonal_out.djvu', dpi)
  File "/usr/lib/python3/dist-packages/djvubind/encode.py", line 84, in _cjb2
    utils.execute(cmd)
  File "/usr/lib/python3/dist-packages/djvubind/utils.py", line 193, in execute
    print(utils.color("err: [utils.execute()] Command exited with bad status.", 
'red'), file=sys.stderr)
NameError: name 'utils' is not defined
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Digging through, I found that the problem is that the call to cjb2 above is
failing when it is fed the file temp_textual.tif which is supposed to be
only bilevel (that is only black and white).

I found (and tested successfully) that temp_textual.tif isn't being
generated as cjb2 expects because the call to convert that created it isn't
creating a bilevel image.

Adding the option -depth 1 to the line that precedes the call to cjb2 fixes
this.  I am including a patch that I tested here.

It would be super nice if you could upload a new version with this change
applied, since djvubind very frequently dies when I try to convert some
books.


Thanks for packaging djvubind,

Rogério Brito.


-- System Information:
Debian Release: buster/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'testing'), (200, 'unstable'), 
(150, 'experimental'), (1, 'buildd-experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf-8, LC_CTYPE=pt_BR.utf-8 (charmap=UTF-8), 
LANGUAGE=en_US.utf-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages djvubind depends on:
ii  djvulibre-bin                    3.5.27.1-8
ii  imagemagick                      8:6.9.9.34+dfsg-3+b1
ii  imagemagick-6.q16 [imagemagick]  8:6.9.9.34+dfsg-3+b1
ii  python3                          3.6.4-1
ii  tesseract-ocr                    4.00~git2219-40f43111-1.2

Versions of packages djvubind recommends:
ii  minidjvu  0.8.svn.2010.05.06+dfsg-5+b4

djvubind suggests no packages.

-- no debconf information

-- 
Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br
>From 99aa73b107a233c8306f157e7351fba8013adb5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbr...@ime.usp.br>
Date: Sat, 14 Apr 2018 01:29:17 -0300
Subject: [PATCH] djvubind/encode: Force file to cjb2 to be only black and
 white.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Note above that convert (Debian's at least), even if asked to
create a monochrome tif will still generate one with 8 bits per
color and cj2b will barf, telling us (correctly) that it is not in
a format that it accepts.

The -depth 1 forces convert to generate a bilevel grayscale tif.

An alternative to using -depth 1 would be to specify the extension
as .pbm, but we would, then, need to modify the name of the file
in more places.

Signed-off-by: Rogério Theodoro de Brito <rbr...@ime.usp.br>
---
 djvubind/encode.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/djvubind/encode.py b/djvubind/encode.py
index b0ed70d..b6622d3 100644
--- a/djvubind/encode.py
+++ b/djvubind/encode.py
@@ -131,7 +131,18 @@ class Encoder:
         #utils.execute('convert -opaque black "{0}" "temp_graphics.tif"'.format(infile))
         #utils.execute('convert +opaque black "{0}" "temp_textual.tif"'.format(infile))
         utils.execute('convert "{0}" -opaque black "temp_graphics.tif"'.format(infile))
-        utils.execute('convert "{0}" +opaque black -monochrome "temp_textual.tif"'.format(infile))
+        utils.execute('convert "{0}" +opaque black -monochrome -depth 1 "temp_textual.tif"'.format(infile))
+
+        # Note above that convert (Debian's at least), even if asked to
+        # create a monochrome tif will still generate one with 8 bits per
+        # color and cj2b will barf, telling us (correctly) that it is not in
+        # a format that it accepts.
+        #
+        # The -depth 1 forces convert to generate a bilevel grayscale tif.
+        #
+        # An alternative to using -depth 1 would be to specify the extension
+        # as .pbm, but we would, then, need to modify the name of the file
+        # in more places.
 
         # Encode the bitonal image.
         self._cjb2('temp_textual.tif', 'enc_bitonal_out.djvu', dpi)
-- 
2.16.3


--- End Message ---
--- Begin Message ---
Source: djvubind
Source-Version: 1.2.1-4

We believe that the bug you reported is fixed in the latest version of
djvubind, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 895...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Clint Adams <cl...@debian.org> (supplier of updated djvubind package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 14 Apr 2018 15:38:44 -0400
Source: djvubind
Binary: djvubind
Architecture: source
Version: 1.2.1-4
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packa...@qa.debian.org>
Changed-By: Clint Adams <cl...@debian.org>
Description:
 djvubind   - simple creation of djvu files
Closes: 895651
Changes:
 djvubind (1.2.1-4) unstable; urgency=medium
 .
   [ Rogério Brito ]
   * djvubind/encode: Force file to cjb2 to be only black and white.
     closes: #895651.
 .
   [ Clint Adams ]
   * Fix watch file
   * Set Maintainer to Debian QA Group
Checksums-Sha1:
 77d7154ed1de2df4edea7873bf81c702cf9a91f5 2023 djvubind_1.2.1-4.dsc
 b238ffd04c1442e379d45b7a207d791690fdc31c 1146105 djvubind_1.2.1.orig.tar.bz2
 9ead0d92e9fd0be4945e7da94023c9b831cb9f9b 1564 djvubind_1.2.1-4.debian.tar.xz
 e4968f6e62489b0c5c8b3787c53749422ddae1fb 4464 djvubind_1.2.1-4_source.buildinfo
Checksums-Sha256:
 bac4ec5d5aef0697592fa3fa5a6099a1e8364ae9a7592e32fa13137e4ff35c16 2023 
djvubind_1.2.1-4.dsc
 440a22ca948fb0cf5f2b6e44b1a59a4754859239aadddfc3a0f974526afc3a9e 1146105 
djvubind_1.2.1.orig.tar.bz2
 5e10f88ec88ceac3363ed59d87e4d87f80ece9f76cbf34e8ed3477af413f647b 1564 
djvubind_1.2.1-4.debian.tar.xz
 0c00d1c35d1ac08a9d572fdcf9df59e51e958cdf1c2fe8d8ae426df21bd9208a 4464 
djvubind_1.2.1-4_source.buildinfo
Files:
 f158c56de68583f89429f1fb793e214e 2023 graphics optional djvubind_1.2.1-4.dsc
 027ee90fec7d6ee5ee921eebfae1dc2d 1146105 graphics optional 
djvubind_1.2.1.orig.tar.bz2
 e5273d9918f80573b92cb2c55a2c7e8e 1564 graphics optional 
djvubind_1.2.1-4.debian.tar.xz
 8fec83a2e613ba9816ec9a6b3f693c03 4464 graphics optional 
djvubind_1.2.1-4_source.buildinfo

-----BEGIN PGP SIGNATURE-----
Comment: Debian!

iQKlBAEBCgCPFiEEdYHsh0BT5sgHeRubVZIzHhmdOKgFAlrSWRNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDc1
ODFFQzg3NDA1M0U2QzgwNzc5MUI5QjU1OTIzMzFFMTk5RDM4QTgRHGNsaW50QGRl
Ymlhbi5vcmcACgkQVZIzHhmdOKgRXw/9Fd28rOwPW8spemFtAYoKrpGp35NEM1L+
35nsxz9khIuf8TdK9nelt/kNSTrVpenXpvPpLcTEcXm5R7lI3LxZpiZK686tYM4C
aBMF+DNDWSCYFFAI2fcD1rOe6uRyxwGc63qaxG7LB7x8BBZSylT050cZes1jcGd2
ANM4AvNNOxNmOMSHcN5HJDiJuiEZhmjEraNTnpz3F5zSf/XgKBnzYIHPzm0enjmp
9JU77gXpAf7RPGUoiKg/6JP0ZA6aAY2Dh75LNzCUC2nn49f3AOnDz2DriORGzyMz
E+CKwQ1qsF7sRYfkljszWdsy+CG+DY5rpjinfYZfwNd0LkaUWToS0SgcebzxJH+g
R6RaRNd9sr3tQ5iiVy8/52/iuCJcGiKiIt5ozsoIJwYZIMY7D0z3PyIcB30ZHntf
2O33SUtcGUVobJXD+R9iNDexzx7Te8mQ7uUufFqg9EVU7yfvVu/675ojX+UzzkI7
7a6360298p8dHmtHtm+0eLlrov7U6a/SfirG7Zk/CT7JLMjFh5Un5y6ZGU+FD80r
ykKGQ6i6OLOglcQsNQ7vWlWySJpVebMrccBjEG14vD2E3Pp2PcdOADwn3BYqIr8Q
MGR/82kUYlw2bNY9Jb5ISFDJdVpJDMkI/ObS1vy8HSeZrziPG5b4Hey6pgdQkQ35
6j4Qpji6+6k=
=V1IW
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to