summaryrefslogtreecommitdiff
path: root/t/34-doc_images-OpenOffice.t
blob: ba32b2d5fc3b8e028041725c494392001667e0d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!perl

BEGIN { chomp($pwd=`pwd`); $ENV{PATH} .= ":$pwd/bin"; };

use Test::More tests => 5;

use HTML::AutoConvert;

my $c = new HTML::AutoConvert;

my $force = 'OpenOffice';
#$c->{'handlers'}{'doc'}{$force}{'weight'} = -1;
my @del = grep { $_ ne $force } keys %{ $c->{'handlers'}{'doc'} };
delete($c->{'handlers'}{'doc'}{$_}) foreach @del;

my( $html, @images ) = $c->html_convert('t/HeatherElko.doc');

ok( scalar(@images) == 2, 'got two 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], '10000000000000C80000009688B0FEF3.png', '1st image name');
ok( length($images[0]->[1]) == 8704, '1st image size');

is( $images[1]->[0], '100000000000009D0000009F54B4BCB3.png', '2nd image name');
ok( length($images[1]->[1]) == 2125, '2nd image size');