Menu

#401 gscan2pdf gets stuck on process 1 of 2 while saving pdf

v1.0_(example)
closed-invalid
nobody
5
2022-09-28
2022-03-03
No

I have some pages that I've scanned. I was able to print them without issue, but when I try to save them as a pdf, the status bar gets stuck on process 1 of 2 and it fails to create the file. I've attached a copy of my debug log.

1 Attachments

Related

Bugs: #401

Discussion

  • Joel Kolodziej

    Joel Kolodziej - 2022-03-14

    I have the same problem for the last week. Last line in debug log is

    WARN - Error creating IM object - Exception 425: improper image header /tmp/gscan2pdf-AFpf/ML5lKwReDl.pnm' @ error/pnm.c/ReadPNMImage/342 WARN - *** unhandled exception in callback: *** Exception 425: improper image header/tmp/gscan2pdf-AFpf/ML5lKwReDl.pnm' @ error/pnm.c/ReadPNMImage/342 at /usr/share/perl5/vendor_perl/Gscan2pdf/Document.pm line 1023.
    *** ignoring at /usr/lib/perl5/5.34/vendor_perl/Glib/Object/Introspection.pm line 67.

    Googling about it seems this might be a glitch in ImageMagick. Since this is an unhandled exception, it seems to block everything else which comes after. I cannot even quit without killing the app/force close. I'm going to try with an older version of ImageMagic and see if that helps.

    EDIT: The issue goes away if post-processing is turned off.

     

    Last edit: Joel Kolodziej 2022-03-22
    • Petr Písař

      Petr Písař - 2022-04-04

      Does it happen to you every time? What kind of scan is it (black-white, gray, colorful)? Can you tell us a version of ImageMagick you have installed? Have you tried inspecting the reportedly malformed PNM file (/tmp/gscan2pdf-AFpf/ML5lKwReDl.pnm in that log output)? Can the PNM file be displayed with an image viewer? With "display" command of ImageMagick?

       
      • Joel Kolodziej

        Joel Kolodziej - 2022-04-05

        Yes, this happens every time. ImageMagick version is 7.1.0.27-1 from the extra repository on Manjaro. However, I cannot invoke it from the command line or from the KDE Plasma search. Best I can do is `_imagemagick' from the command line.
        Calling it from the CLI nets these errors:
        _tags:comptags:36: can only be called from completion function
        _tags:comptry:55: can only be called from completion function
        _tags:comptags:60: can only be called from completion function
        _tags:comptags:67: can only be called from completion function

        I've suspected there's something wrong with my imagemagick install, but I can't find any way to fix it. Reinstalling from pamac changes nothing.

        EDIT: Ok, it helps when you call it with the right command line. However, in my latest scan, none of the files it errors out on exist in the tmp folder. See log below in reply to Jeffrey Ratcliffe. The only pnm file that exists in the tmp folder is the first one fTL7Ii8DM4.pnm.

           /tmp/gscan2pdf-1xaR  ls -l                                                                                                                         ✔ 
        total 6972
        -rw------- 1 crono141 crono141       0 Apr  5 19:40 BqtKv_0Od8.pid
        -rw------- 1 crono141 crono141 3733237 Apr  5 19:40 fTL7Ii8DM4.pnm
        -rw------- 1 crono141 crono141 1696021 Apr  5 19:40 GMXkb0Jgr9.png
        -rw------- 1 crono141 crono141 1696021 Apr  5 19:40 kVZe2HDyzx.png
        -rw-r--r-- 1 crono141 crono141       0 Apr  5 19:39 lockfile
        -rw-r--r-- 1 crono141 crono141      43 Apr  5 19:39 session
        

        gscan2pdf is still running, and stuck on processing 1 of 1 while checking the contents of the tmp folder.

         

        Last edit: Joel Kolodziej 2022-04-06
  • Jeffrey Ratcliffe

    The step that produces the pnm in Joel's case is unpaper. Does activating the "Convert scanned images to PNG before further processing" in Edit/Preferences/General options make any difference?

     
    • Joel Kolodziej

      Joel Kolodziej - 2022-04-05

      I tried checking that this time and I still get the error.

      INFO - New page filename /tmp/gscan2pdf-1xaR/kVZe2HDyzx.png, format Portable Network Graphics
      INFO - New page written as /tmp/gscan2pdf-1xaR/oUDP1ezOcS.png (BEFBB9E0-B539-11EC-9AC9-D06C2EB305D4)
      INFO - Converted /tmp/gscan2pdf-1xaR/fTL7Ii8DM4.pnm to /tmp/gscan2pdf-1xaR/oUDP1ezOcS.png
      INFO - Replaced /tmp/gscan2pdf-1xaR/fTL7Ii8DM4.pnm (BE424DE8-B539-11EC-9AC9-D06C2EB305D4) at page 1 with /tmp/gscan2pdf-1xaR/GMXkb0Jgr9.png (BE424DE8-B539-11EC-9AC9-D06C2EB305D4), resolution 200,200
      DEBUG - Converting /tmp/gscan2pdf-1xaR/GMXkb0Jgr9.png -> /tmp/gscan2pdf-1xaR/531XIAlAEe.pnm for unpaper
      INFO - unpaper --black-threshold 0.33 --border-margin 0,0 --deskew-scan-direction left --layout single --output-pages 1 --white-threshold 0.9 --overwrite /tmp/gscan2pdf-1xaR/531XIAlAEe.pnm /tmp/gscan2pdf-1xaR/6iIePorGHt.pnm
      INFO - Spawned PID 2935
      INFO - Processing sheet #1: /tmp/gscan2pdf-1xaR/531XIAlAEe.pnm -> /tmp/gscan2pdf-1xaR/6iIePorGHt.pnm
      
      INFO - New page filename /tmp/gscan2pdf-1xaR/6iIePorGHt.pnm, format Portable anymap
      INFO - New page written as /tmp/gscan2pdf-1xaR/qms5IhTWYF.pnm (C12FAED8-B539-11EC-9AC9-D06C2EB305D4)
      WARN - Error creating IM object - Exception 425: improper image header `/tmp/gscan2pdf-1xaR/nZiJEeLPuV.pnm' @ error/pnm.c/ReadPNMImage/342
      WARN - *** unhandled exception in callback:
      ***   Exception 425: improper image header `/tmp/gscan2pdf-1xaR/nZiJEeLPuV.pnm' @ error/pnm.c/ReadPNMImage/342 at /usr/share/perl5/vendor_perl/Gscan2pdf/Document.pm line 1023.
      ***  ignoring at /usr/lib/perl5/5.34/vendor_perl/Glib/Object/Introspection.pm line 67.
      
       
  • Jeffrey Ratcliffe

    gscan2pdf should also work with graphicsmagick + the compatibility layer for imagemagick. Can you give that a try? You already have graphicsmagick installed, I see.

     
    • Joel Kolodziej

      Joel Kolodziej - 2022-04-12

      I don't know how to do this.

       
  • Jeffrey Ratcliffe

    Apologies for the delay in responding.

    Debian-based distros offer a compatibility layer:

    https://packages.debian.org/sid/graphicsmagick-imagemagick-compat

    You seem to be using Manjaro, and I couldn't find a similar package for that distro.

    Do you still have this problem?

    If so, we can debug the imagemagick steps.

     
  • Jeffrey Ratcliffe

    Thanks for responding.

     
  • Jeffrey Ratcliffe

    • status: open --> closed-invalid
     

Log in to post a comment.