Menu

#88 Unable to save scanned images

closed
nobody
None
5
2011-09-29
2009-07-17
Ed
No

When scanning gscan2pdf appears to correctly scan the image (from adf or flatbed) and displays thumbnail on the left hand side of the interface. However the scanned image is not displayed in the main section of the interface. The program is unable to save the image as a pnm and when trying to save as another file type (.pdf etc) it creates a blank image . gscan2pdf is creating the out1.pnm file in the tmp directory and changing the name of this file to random letters with .pnm extension. it does not appear to matter what resolution or colours I use to scan as the problem exists with all.

Using Jaunty. All dependencies OK.

Appears to be a similar problem to launchpad bug #204988

gscan2pdf --debug output (attempting to save as .pnm and as .pdf) attached

Discussion

  • Ed

    Ed - 2009-07-17

    debug output

     
  • Jeffrey Ratcliffe

    The --debug output suggests that the scan is not being written to disk completely before gscan2pdf tries to read it.

    The scans are stored in a temporary directory which is deleted when gscan2pdf is closed, e.g. for your --debug output the scan is:

    /tmp/d5VjpRm9fW/eBIKOTTa1Y.pnm

    So, please reproduce the problem, and before closing gscan2pdf, locate the scan and attach it to this bug report and I'll investigate further.

    Also, please try installing gscan2pdf v0.9.29 from the ppa.

     
  • Ed

    Ed - 2009-07-26

    temp scan file

     
  • Ed

    Ed - 2009-07-26

    debug output 2

     
  • Ed

    Ed - 2009-07-26

    Thanks for the quick reply.

    I've reproduced the error using 0.9.27 and attached a) temp pnm file created and b) updated --debug

    The scan does not appear to be finished, as you suggested. The scan should not have the black strip at the bottom. If I try to manually use convert on the temp scan file from a command line I get the same error as gscan2pdf. If I convert another file (not created by gscan2pdf) it works correctly.

    I've just updated to 0.9.29 and get the same errors. The --debug output appears to be the same.

     
  • Jeffrey Ratcliffe

    Patch to flush filesystem before importing scan

     
  • Jeffrey Ratcliffe

    Does this patch help?

    I assume you are using the scanimage frontend (in Edit/Preferences). Do you get the problem with the libsane-perl frontend?

     
  • Ed

    Ed - 2009-07-27

    I was using scanimage.pl in 0.9.27 but tried all front ends in an effort to work out what was going on. When I installed 0.9.99 this changed to libsane-perl and generated the same result. I've just tried with the other front ends and have the same error.

    I am unable to get the patch working. I assume I just run the patch. Output as follows.

    ./patch
    diff: unrecognized option '--git'
    diff: Try `diff --help' for more information.
    ./patch: line 2: index: command not found
    ./patch: line 3: ---: command not found
    ./patch: line 4: +++: command not found
    ./patch: line 5: @@: command not found
    ./patch: line 6: CompuServe graphics interchange format: command not found
    ./patch: line 7: syntax error near unexpected token `)'
    ./patch: line 7: ` );'

     
  • Jeffrey Ratcliffe

    To use the patch type

    patch -p1 /usr/bin/gscan2pdf < patch

     
  • Ed

    Ed - 2009-07-29

    Thanks Jeffrey,

    The patch installed OK. I am still getting the error on saving (or rotating or any imagemagick command on the temp scanned file).

    Extract from debug output copied below.

    asked to lazy-load Glib::Object::_LazyLoader, but that package is not registered at /usr/lib/perl5/Glib.pm line 197.
    asked to lazy-load Gtk2::GC, but that package is not registered at /usr/lib/perl5/Glib.pm line 197.
    asked to lazy-load Gtk2::Gdk::Bitmap, but that package is not registered at /usr/lib/perl5/Glib.pm line 197.
    asked to lazy-load Glib::Object::_LazyLoader, but that package is not registered at /usr/lib/perl5/Glib.pm line 197.
    Found Image::Magick
    Found ImageMagick
    Found scanadf
    Found xdg-email
    Found gocr
    Found tesseract
    Found cjb2 (djvu)
    Found unpaper
    Found libtiff

    <snip>

    scanimage --device-name='net:10.1.1.5:brother:bus4;dev1' --mode='True Gray' --source='FlatBed' --contrast='0' -x 208 -l 0 -y 297 --brightness='0' --resolution='150' -t 0 --batch --progress --batch-count=1
    Forked PID 10236
    scanimage: rounded value of br-x from 208 to 207.981
    scanimage: rounded value of br-x from 208 to 207.981
    scanimage: rounded value of br-y from 297 to 296.973
    Scanning 1 pages, incrementing by 1, numbering from 1
    Scanning page 1
    scanimage: rounded value of br-y from 297 to 296.973
    Scanned page 1. (scanner status = 5)
    Importing out1.pnm, format Portable anymap
    Added /tmp/OSMXhspt3O/8av7uTSrl5.pnm at page 1 with resolution 150
    *** unhandled exception in callback:
    *** Failed to load image '/tmp/OSMXhspt3O/8av7uTSrl5.pnm': Premature end-of-file encountered at /usr/bin/gscan2pdf line 1497.
    *** ignoring at /usr/share/perl5/Gtk2/Ex/Simple/List.pm line 164.
    Waiting to reap process at /usr/bin/gscan2pdf line 5184.
    Reaped PID 10236
    convert /tmp/OSMXhspt3O/8av7uTSrl5.pnm -density 150 '/home/rocketpants/Desktop/test.pnm'
    convert: unable to read image data `/tmp/OSMXhspt3O/8av7uTSrl5.pnm' @ coders/pnm.c/ReadPNMImage/635.
    convert: missing an image filename `/home/rocketpants/Desktop/test.pnm' @ wand/convert.c/ConvertImageCommand/2710.

     
  • Ed

    Ed - 2009-08-06

    Hi Jeffrey,

    Thanks again for y0our continued efforts in developing and fixing gscan2pdf

    The new version (0.9.30) does not work for me. When I scan a page the thumbnail does not appear on the left pane in gscan2pdf. I am unable to save the file as gscan2pdf does not recognise that a file has been scaned.

    In the temp directory created by gscan2pdf there are two files created when I do a scan "out1.pnm" and "session"

    If I try and manually convert the out1.pnm file using <convert out1.pnm -density 200 test1.pnm> I get the following error

    convert out1.pnm -density 200 /home/rocketpants/Desktop/test1.pnm
    convert: unable to read image data `out1.pnm' @ coders/pnm.c/ReadPNMImage/635.
    convert: missing an image filename `/home/rocketpants/Desktop/test1.pnm' @ wand/convert.c/ConvertImageCommand/2710.

    Debug output attached as gscan2pdf debug 3

    Oddly enough, after testing a number of times and having the above problem occur a thumbnail of a scan was displayed in the left pane. When I tried to save the thumbnail I go the same old error. I didn't copy the debug for this event and have been unable to reproduce it.

     
  • Jeffrey Ratcliffe

    Can you still reproduce this with a more recent version of gscan2pdf?

     
  • Ed

    Ed - 2011-09-29

    Sorry Jeffrey, I don't have a working installation of linux (or a scanner for that matter) at the moment.

    Ed

     
  • Jeffrey Ratcliffe

    OK. Then I'll close the bug, as I can't reproduce it. Please feel free to open it again if you run into the same problem in the future.

     
  • Jeffrey Ratcliffe

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB