"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bin/gscan2pdf" between
gscan2pdf-2.13.1.tar.xz and gscan2pdf-2.13.2.tar.xz

About: gscan2pdf is a GUI to produce PDFs from scanned documents (using Perl).

gscan2pdf  (gscan2pdf-2.13.1.tar.xz):gscan2pdf  (gscan2pdf-2.13.2.tar.xz)
skipping to change at line 16 skipping to change at line 16
# Use # Use
# make tidy # make tidy
# TEST_AUTHOR=1 make test # TEST_AUTHOR=1 make test
# immediately before release so as not to affect any patches # immediately before release so as not to affect any patches
# in between, and then consistently before each commit afterwards. # in between, and then consistently before each commit afterwards.
# 0. Test scan in lineart, greyscale and colour. # 0. Test scan in lineart, greyscale and colour.
# 1. New screendump required? Print screen creates screenshot.png in Desktop. # 1. New screendump required? Print screen creates screenshot.png in Desktop.
# Download new translations (https://translations.launchpad.net/gscan2pdf) # Download new translations (https://translations.launchpad.net/gscan2pdf)
# Update translators in credits (https://launchpad.net/gscan2pdf/+topcontribu tors) # Update translators in credits (https://launchpad.net/gscan2pdf/+topcontribu tors)
# Check $VERSION. If necessary bump with something like # Check $VERSION. If necessary bump with something like
# xargs sed -i "s/\(\$VERSION *= \)'2\.13\.0'/\1'2.13.1'/" < MANIFEST # xargs sed -i "s/\(\$VERSION *= \)'2\.13\.1'/\1'2.13.2'/" < MANIFEST
# Make appropriate updates to ../debian/changelog # Make appropriate updates to ../debian/changelog
# 2. perl Makefile.PL # 2. perl Makefile.PL
# Upload .pot # Upload .pot
# 3. make remote-html # 3. make remote-html
# 4. Build .deb for sf # 4. Build .deb for sf
# make signed_tardist # make signed_tardist
# sudo sbuild-update -udr sid-amd64-sbuild # sudo sbuild-update -udr sid-amd64-sbuild
# sbuild -sc sid-amd64-sbuild # sbuild -sc sid-amd64-sbuild
# #debsign .changes # #debsign .changes
# lintian -iI --pedantic .changes # lintian -iI --pedantic .changes
# autopkgtest .changes -- schroot sid-amd64-sbuild
# check contents with dpkg-deb --contents # check contents with dpkg-deb --contents
# test dist sudo dpkg -i gscan2pdf_x.x.x_all.deb # test dist sudo dpkg -i gscan2pdf_x.x.x_all.deb
# 5. git status # 5. git status
# git tag vx.x.x # git tag vx.x.x
# git push --tags origin master # git push --tags origin master
# If the latter doesn't work, try: # If the latter doesn't work, try:
# git push --tags https://ra28145@git.code.sf.net/p/gscan2pdf/code master # git push --tags https://ra28145@git.code.sf.net/p/gscan2pdf/code master
# 6. create version directory in https://sourceforge.net/projects/gscan2pdf/file s/gscan2pdf # 6. create version directory in https://sourceforge.net/projects/gscan2pdf/file s/gscan2pdf
# make file_releases # make file_releases
# 7. Build packages for Debian & Ubuntu # 7. Build packages for Debian & Ubuntu
# name the release -0~ppa1<release>, where release (https://wiki.ubuntu.com/R eleases) is: # name the release -0~ppa1<release>, where release (https://wiki.ubuntu.com/R eleases) is:
# * kinetic (until 2023-07) # * kinetic (until 2023-07)
# * jammy (until 2027-04) # * jammy (until 2027-04)
# * focal (until 2025-04, dh12) # * focal (until 2025-04, dh12)
# * bionic (until 2023-04, dh11, no tests, no fonts-noto-extra, liblocale-c odes-perl >= 3.55, also in Build-Depends-Indep) # * bionic (until 2023-04, dh11, no tests, no fonts-noto-extra, liblocale-c odes-perl >= 3.55, also in Build-Depends-Indep)
# debuild -S -sa # debuild -S -sa
# dput ftp-master .changes # dput ftp-master .changes
# dput gscan2pdf-ppa .changes # dput gscan2pdf-ppa .changes
# https://launchpad.net/~jeffreyratcliffe/+archive # https://launchpad.net/~jeffreyratcliffe/+archive
# 8. gscan2pdf-announce@lists.sourceforge.net, gscan2pdf-help@lists.sourceforge. net, gnome-announce-list@gnome.org, sane-devel@lists.alioth.debian.org # 8. gscan2pdf-announce@lists.sourceforge.net, gscan2pdf-help@lists.sourceforge. net, sane-devel@lists.alioth.debian.org
# 9. To interactively debug in the schroot: # 9. To interactively debug in the schroot:
# duplicate the config file, typically in /etc/schroot/chroot.d/, changing t he sbuild profile to desktop # duplicate the config file, typically in /etc/schroot/chroot.d/, changing t he sbuild profile to desktop
# schroot -c sid-amd64-desktop -u root # schroot -c sid-amd64-desktop -u root
# apt-get build-dep gscan2pdf # apt-get build-dep gscan2pdf
# su - <user> # su - <user>
# xvfb-run prove -lv <tests> # xvfb-run prove -lv <tests>
use warnings; use warnings;
use strict; use strict;
use feature 'switch'; use feature 'switch';
skipping to change at line 89 skipping to change at line 90
use Gtk3::ImageView::Tool::SelectorDragger; use Gtk3::ImageView::Tool::SelectorDragger;
use Gtk3::SimpleList; use Gtk3::SimpleList;
# -init should not be necessary, as we use $app->run, but without it, # -init should not be necessary, as we use $app->run, but without it,
# the config file is saved with the numeric locale # the config file is saved with the numeric locale
# and the application name is shown as Perl in GNOME 3 # and the application name is shown as Perl in GNOME 3
use Gtk3 0.028 -init; use Gtk3 0.028 -init;
use Cwd qw(abs_path getcwd); # To obtain current working directory use Cwd qw(abs_path getcwd); # To obtain current working directory
use File::Basename; # Split filename into dir, file, ext use File::Basename; # Split filename into dir, file, ext
use File::Copy; use File::Copy;
use File::Temp; # To create temporary files use File::Temp; # To create temporary files
use File::Path qw(remove_tree); use File::Path qw(remove_tree);
use Glib qw(TRUE FALSE); # To get TRUE and FALSE use Glib qw(TRUE FALSE); # To get TRUE and FALSE
use PDF::Builder; use PDF::Builder;
use Getopt::Long; use Getopt::Long;
use Set::IntSpan 1.10; # For size method for page numbering issues use Set::IntSpan 1.10; # For size method for page numbering issues
use Proc::Killfam; use Proc::Killfam;
use Fcntl qw(:flock) use Fcntl qw(:flock)
; # import LOCK_* constants to prevent us clobbering running instances ; # import LOCK_* constants to prevent us clobbering running instances
use Log::Log4perl; use Log::Log4perl;
use Try::Tiny; use Try::Tiny;
use Data::Dumper; use Data::Dumper;
$Data::Dumper::Sortkeys = 1; $Data::Dumper::Sortkeys = 1;
use Filesys::Df; use Filesys::Df;
use English qw( -no_match_vars ) use English qw( -no_match_vars )
; # for $PERL_VERSION, $PROGRAM_NAME, $EVAL_ERROR, $ERRNO ; # for $PERL_VERSION, $PROGRAM_NAME, $EVAL_ERROR, $ERRNO
skipping to change at line 161 skipping to change at line 162
Readonly my $_1MB => $_1KB * $_1KB; Readonly my $_1MB => $_1KB * $_1KB;
Readonly my $_100_000MB => 100_000; Readonly my $_100_000MB => 100_000;
Readonly my $ZOOM_CONTEXT_FACTOR => 0.5; Readonly my $ZOOM_CONTEXT_FACTOR => 0.5;
Glib::set_application_name('gscan2pdf'); Glib::set_application_name('gscan2pdf');
#Glib::set_prgname('net.sourceforge.gscan2pdf'); #Glib::set_prgname('net.sourceforge.gscan2pdf');
Glib::Object::Introspection->invoke( 'GLib', undef, 'set_prgname', Glib::Object::Introspection->invoke( 'GLib', undef, 'set_prgname',
'net.sourceforge.gscan2pdf' ); 'net.sourceforge.gscan2pdf' );
my $prog_name = Glib::get_application_name; my $prog_name = Glib::get_application_name;
my $VERSION = '2.13.1'; my $VERSION = '2.13.2';
# Image border to ensure that a scaled to fit image gets no scrollbars # Image border to ensure that a scaled to fit image gets no scrollbars
my $border = 1; my $border = 1;
my $debug = FALSE; my $debug = FALSE;
my $EMPTY = q{}; my $EMPTY = q{};
my $SPACE = q{ }; my $SPACE = q{ };
my $DOT = q{.}; my $DOT = q{.};
my $PERCENT = q{%}; my $PERCENT = q{%};
my $ASTERISK = q{*}; my $ASTERISK = q{*};
skipping to change at line 216 skipping to change at line 217
$logger->info( 'Built for Glib ' . join $DOT, Glib->GET_VERSION_INFO ); $logger->info( 'Built for Glib ' . join $DOT, Glib->GET_VERSION_INFO );
$logger->info( $logger->info(
'Running with Glib ' . join $DOT, Glib::major_version, 'Running with Glib ' . join $DOT, Glib::major_version,
Glib::minor_version, Glib::micro_version Glib::minor_version, Glib::micro_version
); );
$logger->info("Gtk3-Perl version $Gtk3::VERSION"); $logger->info("Gtk3-Perl version $Gtk3::VERSION");
$logger->info( 'Built for GTK ' . join $DOT, $logger->info( 'Built for GTK ' . join $DOT,
( Gtk3->MAJOR_VERSION, Gtk3->MINOR_VERSION, Gtk3->MICRO_VERSION ) ); ( Gtk3->MAJOR_VERSION, Gtk3->MINOR_VERSION, Gtk3->MICRO_VERSION ) );
$logger->info( $logger->info(
'Running with GTK ' . join $DOT, 'Running with GTK ' . join $DOT,
( Gtk3::get_major_version, Gtk3::get_minor_version, (
Gtk3::get_major_version, Gtk3::get_minor_version,
Gtk3::get_micro_version Gtk3::get_micro_version
) )
); );
$logger->info("Gtk3::SimpleList version $Gtk3::SimpleList::VERSION"); $logger->info("Gtk3::SimpleList version $Gtk3::SimpleList::VERSION");
$logger->info("Gscan2pdf::Document version $Gscan2pdf::Document::VERSION"); $logger->info("Gscan2pdf::Document version $Gscan2pdf::Document::VERSION");
if ( $Gscan2pdf::Document::VERSION ne $VERSION ) { if ( $Gscan2pdf::Document::VERSION ne $VERSION ) {
$logger->fatal( $logger->fatal(
sprintf sprintf
'Mismatch between Gscan2pdf::Document version %s and executable version %s.', 'Mismatch between Gscan2pdf::Document version %s and executable version %s.',
skipping to change at line 1192 skipping to change at line 1194
my $size = $Gscan2pdf::Document::POINTS_PER_INCH; my $size = $Gscan2pdf::Document::POINTS_PER_INCH;
$page->mediabox( $size, $size ); $page->mediabox( $size, $size );
my $gfx = $page->gfx; my $gfx = $page->gfx;
my $imgobj = $pdfobj->image_jpeg($tempimg); my $imgobj = $pdfobj->image_jpeg($tempimg);
$gfx->image( $imgobj, 0, 0, $size, $size ); $gfx->image( $imgobj, 0, 0, $size, $size );
$pdfobj->save; $pdfobj->save;
$pdfobj->end; $pdfobj->end;
( undef, my $out ) = Gscan2pdf::Document::exec_command( ( undef, my $out ) = Gscan2pdf::Document::exec_command(
[ $name, $temppdf, 'dump_data' ] ); [ $name, $temppdf, 'dump_data' ] );
if ( $out !~ /NumberOfPages/xsm ) { my $msg;
delete $dependencies{$name}; if ( $out =~
my $msg = __( /Error:[ ]could[ ]not[ ]load[ ]a[ ]required[ ]library/xsm )
{
$msg = sprintf __(
"pdftk is installed, but seems to be missing required dependencies:\n%s"
), $out;
}
elsif ( $out !~ /NumberOfPages/xsm ) {
$msg = __(
'pdftk is installed, but cannot access the directory used for temporary files.' 'pdftk is installed, but cannot access the directory used for temporary files.'
) )
. __( . __(
'One reason for this might be that pdftk was installed via snap.' 'One reason for this might be that pdftk was installed via snap.'
) )
. __( . __(
'In this case, removing pdftk, and reinstalling without using snap would allow g scan2pdf to use pdftk.' 'In this case, removing pdftk, and reinstalling without using snap would allow g scan2pdf to use pdftk.'
) )
. __( . __(
'Another workaround would be to select a temporary directory under your home dir ectory in Edit/Preferences.' 'Another workaround would be to select a temporary directory under your home dir ectory in Edit/Preferences.'
); );
}
if ($msg) {
delete $dependencies{$name};
show_message_dialog( show_message_dialog(
parent => $window, parent => $window,
type => 'warning', type => 'warning',
buttons => 'ok', buttons => 'ok',
text => $msg, text => $msg,
'store-response' => TRUE 'store-response' => TRUE
); );
} }
} }
} }
skipping to change at line 2806 skipping to change at line 2818
} }
} }
else { else {
$datetime = $dialog->get('meta-datetime'); $datetime = $dialog->get('meta-datetime');
} }
my $success = TRUE; my $success = TRUE;
if ( defined $datetime ) { if ( defined $datetime ) {
try { try {
$SETTING{'datetime offset'} = $SETTING{'datetime offset'} =
[ Delta_DHMS( Today_and_Now(), @{$datetime} ) ]; [ Delta_DHMS( Today_and_Now(), @{$datetime} ) ];
$SETTING{'timezone offset'} =
[ Gscan2pdf::Document::delta_timezone_to_current($datetime) ];
} }
catch { catch {
$success = FALSE; $success = FALSE;
my $msg = my $msg =
sprintf __( sprintf __(
'%04d-%02d-%02d %02d:%02d:%02d is not a valid datetime.'), '%04d-%02d-%02d %02d:%02d:%02d is not a valid datetime: %s'),
@{$datetime}; @{$datetime}, $_;
$logger->debug($msg); $logger->debug($msg);
show_message_dialog( show_message_dialog(
parent => $window, parent => $window,
type => 'error', type => 'error',
buttons => 'close', buttons => 'close',
text => $msg, text => $msg,
); );
}; };
$SETTING{'timezone offset'} =
[ Gscan2pdf::Document::delta_timezone_to_current($datetime) ];
} }
return $success; return $success;
} }
# Save selected pages as PDF under given name. # Save selected pages as PDF under given name.
sub save_pdf { sub save_pdf {
my ( $filename, $option, $list_of_pages ) = @_; my ( $filename, $option, $list_of_pages ) = @_;
# Compile options # Compile options
skipping to change at line 3429 skipping to change at line 3441
# cd back to tempdir # cd back to tempdir
chdir $session; chdir $session;
if ( @{$list_of_pages} > 1 ) { if ( @{$list_of_pages} > 1 ) {
my $w = length scalar @{$list_of_pages}; my $w = length scalar @{$list_of_pages};
for ( 1 .. @{$list_of_pages} ) { for ( 1 .. @{$list_of_pages} ) {
my $current_filename = my $current_filename =
sprintf "${filename}_%0${w}d.$SETTING{'image type'}", sprintf "${filename}_%0${w}d.$SETTING{'image type'}",
$_; $_;
return if ( file_exists( $file_chooser, $current_filename ) ); if ( -f $current_filename ) {
return if ( file_writable( $file_chooser, $current_filename ) ); my $text = sprintf __('This operation would overwrite %s'),
$current_filename;
show_message_dialog(
parent => $file_chooser,
type => 'error',
buttons => 'close',
text => $text
);
$file_chooser->destroy;
return;
}
} }
$filename = "${filename}_%0${w}d.$SETTING{'image type'}"; $filename = "${filename}_%0${w}d.$SETTING{'image type'}";
} }
else { else {
if ( $filename !~ /[.]$SETTING{'image type'}$/ixsm ) { if ( $filename !~ /[.]$SETTING{'image type'}$/ixsm ) {
$filename = "$filename.$SETTING{'image type'}"; $filename = "$filename.$SETTING{'image type'}";
return if ( file_exists( $file_chooser, $filename ) ); return if ( file_exists( $file_chooser, $filename ) );
} }
return if ( file_writable( $file_chooser, $filename ) ); return if ( file_writable( $file_chooser, $filename ) );
} }
skipping to change at line 3470 skipping to change at line 3492
finished_callback => sub { finished_callback => sub {
my ( $new_page, $pending ) = @_; my ( $new_page, $pending ) = @_;
if ( not $pending ) { $thbox->hide } if ( not $pending ) { $thbox->hide }
if ( defined $signal ) { if ( defined $signal ) {
$tcbutton->signal_handler_disconnect($signal); $tcbutton->signal_handler_disconnect($signal);
} }
mark_pages($list_of_pages); mark_pages($list_of_pages);
if ( defined $SETTING{'view files toggle'} if ( defined $SETTING{'view files toggle'}
and $SETTING{'view files toggle'} ) and $SETTING{'view files toggle'} )
{ {
launch_default_for_file($filename); if ( @{$list_of_pages} > 1 ) {
my $w = length scalar @{$list_of_pages};
for ( 1 .. @{$list_of_pages} ) {
launch_default_for_file( sprintf ${filename}, $_ );
}
}
else {
launch_default_for_file($filename);
}
} }
$logger->debug("Finished saving $filename"); $logger->debug("Finished saving $filename");
}, },
error_callback => \&error_callback error_callback => \&error_callback
); );
if ( defined $windowi ) { $windowi->hide } if ( defined $windowi ) { $windowi->hide }
} }
$file_chooser->destroy; $file_chooser->destroy;
return; return;
skipping to change at line 5092 skipping to change at line 5122
Berov Berov
Utku BERBEROĞLU Utku BERBEROĞLU
Arthur Rodrigues Arthur Rodrigues
Matthias Sprau Matthias Sprau
Buckethead Buckethead
Eugen Artus Eugen Artus
Quentin PAGÈS Quentin PAGÈS
Alexandre NICOLADIE Alexandre NICOLADIE
Aleksandr Proklov Aleksandr Proklov
Silvio Brera Silvio Brera
papoteur
EOS EOS
$about->set_translator_credits($translators); $about->set_translator_credits($translators);
$about->set_artists( ['lodp, Andreas E.'] ); $about->set_artists( ['lodp, Andreas E.'] );
$about->set_logo( $about->set_logo(
Gtk3::Gdk::Pixbuf->new_from_file("$iconpath/gscan2pdf.svg") ); Gtk3::Gdk::Pixbuf->new_from_file("$iconpath/gscan2pdf.svg") );
$about->set_transient_for($window); $about->set_transient_for($window);
$about->run; $about->run;
$about->destroy; $about->destroy;
return; return;
} }
skipping to change at line 5257 skipping to change at line 5288
return; return;
} }
# Handle right-clicks # Handle right-clicks
sub handle_clicks { sub handle_clicks {
my ( $widget, $event ) = @_; my ( $widget, $event ) = @_;
if ( $event->button == $RIGHT_MOUSE_BUTTON ) { if ( $event->button == $RIGHT_MOUSE_BUTTON ) {
if ( $widget->isa('Gtk3::ImageView') ) { # main image if ( $widget->isa('Gtk3::ImageView') ) { # main image
$uimanager->get_widget('/Detail_Popup') $uimanager->get_widget('/Detail_Popup')->popup_at_pointer($event);
->popup_at_pointer( $event );
} }
else { # Thumbnail simplelist else { # Thumbnail simplelist
$SETTING{'Page range'} = 'selected'; $SETTING{'Page range'} = 'selected';
$uimanager->get_widget('/Thumb_Popup') $uimanager->get_widget('/Thumb_Popup')->popup_at_pointer($event);
->popup_at_pointer( $event );
} }
# block event propagation # block event propagation
return TRUE; return TRUE;
} }
# allow event propagation # allow event propagation
return FALSE; return FALSE;
} }
 End of changes. 18 change blocks. 
21 lines changed or deleted 50 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)