6
6
# change 'tests => 1' to 'tests => last_test_to_print';
8
10
use Test::More tests => 3;
11
use_ok('Gscan2pdf::Document');
14
use_ok('Gscan2pdf::Document');
14
17
#########################
21
24
our $heightt = 100;
23
26
use Log::Log4perl qw(:easy);
24
Log::Log4perl->easy_init($DEBUG);
27
Log::Log4perl->easy_init($WARN);
25
28
our $logger = Log::Log4perl::get_logger;
26
29
my $prog_name = 'gscan2pdf';
27
30
use Locale::gettext 1.05; # For translations
28
31
our $d = Locale::gettext->domain($prog_name);
29
Gscan2pdf->setup($d, $logger);
32
Gscan2pdf->setup( $d, $logger );
31
34
# Create test image
32
35
system('convert rose: test.pnm');
34
37
my $slist = Gscan2pdf::Document->new;
35
$slist->get_file_info( 'test.pnm', undef, undef, undef, sub {
37
$slist->import_file( $info, 1, 1, undef, undef, undef, sub {
38
$slist->save_image('test.jpg', [ $slist->{data}[0][2] ], undef, undef, undef, sub {Gtk2->main_quit});
38
$slist->get_file_info(
44
$info, 1, 1, undef, undef, undef,
46
$slist->save_image( 'test.jpg', [ $slist->{data}[0][2] ],
47
undef, undef, undef, sub { Gtk2->main_quit } );
43
is( system( 'identify test.jpg' ), 0, 'valid JPG created' );
54
is( system('identify test.jpg'), 0, 'valid JPG created' );
45
56
#########################