Menu

#406 Cannot read linked files

v1.0_(example)
closed-fixed
nobody
None
5
2022-10-15
2022-10-14
No

I am using version 2.12.6 of gscan2pdf on xubuntu 22.04. A symbolic link to a tiff file hangs the user interface when you open it. I see a blank gscan2pdf screen with the progress bar at the bottom, stuck on "Process 1 of 3 (import file - importing page 1 of 1)". After this nothing works until I close gscan2pdf and open it again. Opening the file that is the link target works correctly. This is a recent bug, I have used gscan2pdf for years and I have used it with symbolic linked files without problem until now.

Discussion

  • Jeffrey Ratcliffe

    Thanks for the report. I can reproduce this. I think this must have been triggered by a change in the behaviour of the "file" tool, as I haven't changed this part of the code recently.

     
  • Jeffrey Ratcliffe

    Indeed, the following patch fixes things for me.

    diff --git a/lib/Gscan2pdf/Document.pm b/lib/Gscan2pdf/Document.pm
    index 97f86972..cb13470a 100644
    --- a/lib/Gscan2pdf/Document.pm
    +++ b/lib/Gscan2pdf/Document.pm
    @@ -2810,7 +2810,7 @@ sub _thread_get_file_info {
    
         $logger->info("Getting info for $options{filename}");
         ( undef, my $format ) =
    
    -      exec_command( [ 'file', '-b', $options{filename} ] );
    +      exec_command( [ 'file', '-Lb', $options{filename} ] );
         chomp $format;
         $logger->info("Format: '$format'");
    
     
  • Jeffrey Ratcliffe

    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB