Bug#486553: gscan2pdf: unable to save as DjVu
* Jeffrey Ratcliffe [EMAIL PROTECTED], 2008-06-16, 23:58: A minimal example can be created with the following command: $ printf 'P6 1 1 255\n\0\0\0' tmp.ppm The problem here is distinguishing between a pbm, which cjb2 will convert, and ppm, which it will not. Imagemagick identifies them both as Format: PNM (Portable anymap) The 'class' attribute can be used to distinguish between those types: $ identify tmp.pbm; identify tmp.ppm tmp.pbm PNM 1x1 1x1+0+0 PseudoClass 2c 1-bit 8b tmp.ppm PNM 1x1 1x1+0+0 DirectClass 8-bit 14b [...] Unless you have any better suggestions, I'll file this as an imagemagick bug, blocking this one. The attached patch should fix the issue. -- Jakub Wilk --- gscan2pdf.orig 2008-06-17 17:15:37.0 +0200 +++ gscan2pdf 2008-06-17 17:27:24.0 +0200 @@ -2943,6 +2943,7 @@ my $x = $image-Read($filename); warn $x if $x; my $depth = $image-Get('depth'); + my $class = $image-Get('class'); my $compression; # c44 can only use pnm and jpg @@ -2959,8 +2960,8 @@ # cjb2 can only use pnm and tif else { $compression = 'cjb2'; - if ($format !~ /(pnm)|(tif)/) { - my (undef, $pnm) = tempfile(DIR = $dir, SUFFIX = '.pnm'); + if ($format !~ /(pnm)|(tif)/ or $class eq 'DirectClass') { + my (undef, $pnm) = tempfile(DIR = $dir, SUFFIX = '.pbm'); $x = $image-Write(filename = $pnm); warn $x if $x; $filename = $pnm;
Bug#486553: gscan2pdf: unable to save as DjVu
2008/6/17 Jakub Wilk [EMAIL PROTECTED]: The 'class' attribute can be used to distinguish between those types: $ identify tmp.pbm; identify tmp.ppm tmp.pbm PNM 1x1 1x1+0+0 PseudoClass 2c 1-bit 8b tmp.ppm PNM 1x1 1x1+0+0 DirectClass 8-bit 14b Thanks for this. In the mean time I had come to exactly the same conclusion, with an almost identical patch. Regards Jeff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#486553: gscan2pdf: unable to save as DjVu
Package: gscan2pdf Version: 0.9.24-1 Severity: normal Trying to save a non-bitonal image as DjVu triggers an error: *** [1-13800] Unknown PBM, PGM or RLE file format. *** (GBitmap.cpp:344) *** 'void DJVU::GBitmap::init(DJVU::ByteStream, int)' *** [1-12308] File 'file://localhost/tmp/BMc51YtRI8/9Ba9TngeH2.djvu' is not a single page DjVu file. *** (DjVuDocEditor.cpp:872) *** 'void DJVU::DjVuDocEditor::insert_group(const DJVU::GListDJVU::GURL, int, void (*)(void*), void*)' -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (900, 'testing'), (600, 'unstable'), (500, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=pl_PL.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages gscan2pdf depends on: ii imagemagick 7:6.3.7.9.dfsg1-2+b2 image manipulation programs ii libconfig-general-p 2.38-1 Generic Configuration Module ii libgtk2-ex-simple-l 0.50-1.1 A simple interface to Gtk2's compl ii libgtk2-imageview-p 0.04-1+b1Perl bindings for the GtkImageView ii liblocale-gettext-p 1.05-4 Using libc functions for internati ii libpdf-api2-perl0.69-2 create or modify PDF documents in ii librsvg2-common 2.22.2-2 SAX-based renderer library for SVG ii libsane 1.0.19-10API library for scanners ii libtiff-tools 3.8.2-8 TIFF manipulation and conversion t ii perlmagick 7:6.3.7.9.dfsg1-2+b2 Perl interface to the libMagick gr ii sane-utils 1.0.19-10API library for scanners -- utilit Versions of packages gscan2pdf recommends: ii djvulibre-bin 3.5.20-7 Utilities for the DjVu image forma pn gocr none (no description available) pn libgtk2-ex-podviewer-perl none (no description available) pn sane none (no description available) ii tesseract-ocr 2.03-1 Command line OCR tool pn unpaper none (no description available) ii xdg-utils 1.0.2-6desktop integration utilities from -- no debconf information -- Jakub Wilk -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#486553: gscan2pdf: unable to save as DjVu
2008/6/16 Jakub Wilk [EMAIL PROTECTED]: Trying to save a non-bitonal image as DjVu triggers an error: Not true in general, however. You can import, say, a JPEG, and save it as DjVu perfectly well. If you have an image which you can import and saving as a DjVu produces this error, please attach it and I will look at it. Regards Jeff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#486553: gscan2pdf: unable to save as DjVu
2008/6/16 Jakub Wilk [EMAIL PROTECTED]: Trying to save a non-bitonal image as DjVu triggers an error: Yes. This is highly annoying - caused by imagemagick writing a 1-bit image as 8-bit and djvu not accepting it. http://www.mail-archive.com/[EMAIL PROTECTED]/msg00181.html The first part of this I reported in #481831, and was apparently fixed in imagemagick/7:6.4.1.3.dfsg1-1. I see you are running 7:6.3.7.9.dfsg1-2+b2. Might I ask you to upgrade your imagemagick package and see if you can still reproduce this? Regards Jeff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#486553: gscan2pdf: unable to save as DjVu
2008/6/16 Jakub Wilk [EMAIL PROTECTED]: A minimal example can be created with the following command: $ printf 'P6 1 1 255\n\0\0\0' tmp.ppm The problem here is distinguishing between a pbm, which cjb2 will convert, and ppm, which it will not. Imagemagick identifies them both as Format: PNM (Portable anymap) However, if you convert tmp.ppm tmp.pbm Then gscan2pdf will import and save the file as djvu. Unless you have any better suggestions, I'll file this as an imagemagick bug, blocking this one. Jeff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#486553: gscan2pdf: unable to save as DjVu
* Jeffrey Ratcliffe [EMAIL PROTECTED], 2008-06-16, 23:07: Trying to save a non-bitonal image as DjVu triggers an error: Yes. This is highly annoying - caused by imagemagick writing a 1-bit image as 8-bit and djvu not accepting it. http://www.mail-archive.com/[EMAIL PROTECTED]/msg00181.html The first part of this I reported in #481831, and was apparently fixed in imagemagick/7:6.4.1.3.dfsg1-1. I see you are running 7:6.3.7.9.dfsg1-2+b2. Might I ask you to upgrade your imagemagick package and see if you can still reproduce this? I have upgraded both imagemagick and perlmagick and the bug is still there. A minimal example can be created with the following command: $ printf 'P6 1 1 255\n\0\0\0' tmp.ppm -- Jakub Wilk -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]