#128 pnm or pbm format don't load

closed
nobody
None
5
2012-03-08
2012-02-22
f_noel
No

Pretty sure pbm files use to load just fine. I noticed that they weren't listed anymore but pnm was. So I converted my pbm file (created with "unpaper -t pbm" from a gray scale png) to pnm. It tries to load but fails. Also tried converting a grayscale png to pnm format and that failed too. In the attached logfile I tried loading a binary pnm, binary gif, grayscale png, binary tif and finally a grayscale png. Neither pnm, binary or grayscale loaded so that you could see an image. There number without a thumb was present along the left side though.

And relating to a differnet bug, ocropus could process the binary tif file okay and generate expected output. I just tested that and don't have that log portion in the attached logfile.

Discussion

  • f_noel

    f_noel - 2012-02-22

    Logfile output

     
  • f_noel

    f_noel - 2012-02-23

    I'm using Ubuntu Karmic 9.10.

    gtk2-engines-pixbuf version 2.20.0

    if that makes any difference.

    Peeking in the /tmp directory after trying to open these files reveals a 0k length png file.

    I'm pretty sure this used to work in gscan2pdf ver 0.9.30. That was the last time I created a pdf with pbm files using gscan2pdf.

    I'll try a few more things and see if I can narrow it down any farther. I looked at the pixbuf pointer, but I don't understand how it applies here...

     
  • Jeffrey Ratcliffe

    What the command

    gdk-pixbuf-query-loaders

    return?

     
  • f_noel

    f_noel - 2012-02-25

    Suspect you want to know about "libpixbufloader-pnm.so"? Query output below.

    I tried renaming it and then running eog (eye of gnome) to view a pbm format file. It wouldn't work, told me it couldn't find the file I renamed. So I think this lib file is functional...

    Thanks for sticking with me :)

    user@comp:~$ gdk-pixbuf-query-loaders
    # GdkPixbuf Image Loader Modules file
    # Automatically generated file, do not edit
    # Created by gdk-pixbuf-query-loaders from gtk+-2.20.0
    #
    # LoaderDir = /usr/lib/gtk-2.0/2.10.0/loaders
    #
    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-tga.so"
    "tga" 4 "gtk20" "The Targa image format" "LGPL"
    "image/x-tga" ""
    "tga" "targa" ""
    " \001\001" "x " 100
    " \001\t" "x " 100
    " \002" "xz " 99
    " \003" "xz " 100
    " \n" "xz " 100
    " \013" "xz " 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-gif.so"
    "gif" 4 "gtk20" "The GIF image format" "LGPL"
    "image/gif" ""
    "gif" ""
    "GIF8" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so"
    "png" 5 "gtk20" "The PNG image format" "LGPL"
    "image/png" ""
    "png" ""
    "\211PNG\r\n\032\n" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-xpm.so"
    "xpm" 4 "gtk20" "The XPM image format" "LGPL"
    "image/x-xpixmap" ""
    "xpm" ""
    "/* XPM */" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-pcx.so"
    "pcx" 4 "gtk20" "The PCX image format" "LGPL"
    "image/x-pcx" ""
    "pcx" ""
    "\n \001" "" 100
    "\n\002\001" "" 100
    "\n\003\001" "" 100
    "\n\004\001" "" 100
    "\n\005\001" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-icns.so"
    "icns" 4 "gtk20" "The ICNS image format" "GPL"
    "image/x-icns" ""
    "icns" ""
    "icns" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-xbm.so"
    "xbm" 4 "gtk20" "The XBM image format" "LGPL"
    "image/x-xbitmap" ""
    "xbm" ""
    "#define " "" 100
    "/*" "" 50

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-bmp.so"
    "bmp" 5 "gtk20" "The BMP image format" "LGPL"
    "image/bmp" "image/x-bmp" "image/x-MS-bmp" ""
    "bmp" ""
    "BM" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-pnm.so"
    "pnm" 4 "gtk20" "The PNM/PBM/PGM/PPM image format family" "LGPL"
    "image/x-portable-anymap" "image/x-portable-bitmap" "image/x-portable-graymap" "image/x-portable-pixmap" ""
    "pnm" "pbm" "pgm" "ppm" ""
    "P1" "" 100
    "P2" "" 100
    "P3" "" 100
    "P4" "" 100
    "P5" "" 100
    "P6" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-jpeg.so"
    "jpeg" 5 "gtk20" "The JPEG image format" "LGPL"
    "image/jpeg" ""
    "jpeg" "jpe" "jpg" ""
    "\377\330" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/io-wmf.so"
    "wmf" 0 "gtk20" "Windows Metafile" ""
    "image/x-wmf" ""
    "wmf" "apm" ""
    "\327\315\306\232" "" 100
    "\001" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-ras.so"
    "ras" 4 "gtk20" "The Sun raster image format" "LGPL"
    "image/x-cmu-raster" "image/x-sun-raster" ""
    "ras" ""
    "Y\246j\225" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-ico.so"
    "ico" 5 "gtk20" "The ICO image format" "LGPL"
    "image/x-icon" "image/x-ico" "image/x-win-bitmap" ""
    "ico" "cur" ""
    " \001 " "zz znz" 100
    " \002 " "zz znz" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-jasper.so"
    "jpeg2000" 4 "gtk20" "The JPEG 2000 image format" "LGPL"
    "image/jp2" "image/jpeg2000" "image/jpx" ""
    "jp2" "jpc" "jpx" "j2k" "jpf" ""
    " jP" "!!!! " 100
    "\377O\377Q" "" 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-wbmp.so"
    "wbmp" 4 "gtk20" "The WBMP image format" "LGPL"
    "image/vnd.wap.wbmp" ""
    "wbmp" ""
    " " "zz" 1
    " `" "z " 1
    " @" "z " 1
    " " "z " 1

    "/usr/lib/gtk-2.0/2.10.0/loaders/svg_loader.so"
    "svg" 2 "gtk20" "Scalable Vector Graphics" "LGPL"
    "image/svg+xml" "image/svg" "image/svg-xml" "image/vnd.adobe.svg+xml" "text/xml-svg" "image/svg+xml-compressed" ""
    "svg" "svgz" "svg.gz" ""
    " <svg" "* " 100
    " <!DOCTYPE svg" "* " 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-tiff.so"
    "tiff" 1 "gtk20" "The TIFF image format" "LGPL"
    "image/tiff" ""
    "tiff" "tif" ""
    "MM *" " z " 100
    "II* " " z" 100
    "II* \020 CR\002 " " z zzz z" 0

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-qtif.so"
    "qtif" 4 "gtk20" "The QTIF image format" "LGPL"
    "image/x-quicktime" "image/qtif" ""
    "qtif" "qif" ""
    "abcdidsc" "xxxx " 100
    "abcdidat" "xxxx " 100

    "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-ani.so"
    "ani" 4 "gtk20" "The ANI image format" "LGPL"
    "application/x-navi-animation" ""
    "ani" ""
    "RIFF ACON" " xxxx " 100

     
  • Jeffrey Ratcliffe

    Please

    a. post an example pnm/pbm that gscan2pdf 1.0.1 doesn't open
    b. see if an earlier version of gscan2pdf has the same problem

     
  • f_noel

    f_noel - 2012-03-07

    I've been working on this myself and her is what I managed to figure out.

    The problem/bug seems to have been with my core perl file:

    /usr/share/perl/5.10/File/Copy.pm

    The following message was coming up in the console output when trying to work with pnm files:

    Argument "/tmp/43NdKGHahK.png" isn't numeric in numeric eq (==) at /usr/share/perl/5.10/File/Copy.pm line 70.

    Whether you get this or not depends on which version of Copy.pm you have on your system. Mine is ver 2.11. Some more info from someone who seems to have struggled with this can be found a little over halfway down on this page (search for "File::Copy 2.10"):

    http://cpan.uwinnipeg.ca/htdocs/Cantella-Store-UUID/Cantella/Store/UUID.pm.html

    It appears that he checks for which version of Copy.pm you have and then directs you to his own solution if your version is buggy. I'm guessing here, I'm not very good with perl...

    Someone else created a patch/solution here:

    http://www.nntp.perl.org/group/perl.perl5.porters/2007/12/msg131419.html

    I've attached the patch I used for "Copy.pm", which seems to apply okay and now I can load pnm and pbm files.

    If you installed from src files, "make test" would also show this problem. It would fail at/on:

    111_save_pdf.t

    Probably other tests would fail too, but the script ended at that point for me. All the tests run now with my modified/patched version of "Copy.pm".

    As far as I am concerned you can close this bug, it isn't/wasn't really gscan2pdf's problem, as you suspected...

     
  • f_noel

    f_noel - 2012-03-07

    Patch for Perl 5.10 Copy.pm ver 2.11

     
  • Jeffrey Ratcliffe

    Thanks for the update

     
  • Jeffrey Ratcliffe

    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks