diff options
author | ivan <ivan> | 2008-08-12 04:02:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-08-12 04:02:02 +0000 |
commit | 9fbeda1dc776c602ce14d3874368d4620c079b60 (patch) | |
tree | 1c4eeceb1a881caa99dd2e2d600c0c637bb87df2 /t/46-pdf_images-poppler.t | |
parent | cba80d78f46ea7541c37efd54262ab1c0dff67e9 (diff) |
add image handling and prevent leaking temporary files (ourselves, Archive::Zip might be)
Diffstat (limited to 't/46-pdf_images-poppler.t')
-rw-r--r-- | t/46-pdf_images-poppler.t | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/46-pdf_images-poppler.t b/t/46-pdf_images-poppler.t new file mode 100644 index 0000000..9bc1fc1 --- /dev/null +++ b/t/46-pdf_images-poppler.t @@ -0,0 +1,38 @@ +#!perl + +use Test::More tests => 9; + +use HTML::AutoConvert; + +my $c = new HTML::AutoConvert; + +my $force = 'poppler'; +#$c->{'handlers'}{'doc'}{$force}{'weight'} = -1; +my @del = grep { $_ ne $force } keys %{ $c->{'handlers'}{'pdf'} }; +delete($c->{'handlers'}{'pdf'}{$_}) foreach @del; + +my( $html, @images ) = $c->html_convert('t/attitude.pdf'); + +ok( scalar(@images) == 21, 'got 21 images' ); + +#save em off +#foreach my $image (@images) { +# my( $file, $data) = @$image; +# open(FILE, ">t/$file") or die $!; +# print FILE $data; +# close FILE or die $!; +#} + +#check the names & lengths at least +is( $images[0]->[0], '000.ppm', '1st image name'); +ok( length($images[0]->[1]) == 25949, '1st image size'); + +is( $images[1]->[0], '001.ppm', '2nd image name'); +ok( length($images[1]->[1]) == 43664, '1st image size'); + +is( $images[2]->[0], '002.ppm', '3rd image name'); +ok( length($images[2]->[1]) == 46833, '1st image size'); + +is( $images[9]->[0], '009.ppm', '10th image name'); +ok( length($images[9]->[1]) == 46374, '10th image size'); + |