X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cdfb4ab1a3c60bf699b8d77618ec9bdf526cdb35..b63f1260eef70cf7eb1703ebae1244db7cef0583:/t/img.t?ds=sidebyside diff --git a/t/img.t b/t/img.t index e02e54fc2..b73988b7c 100755 --- a/t/img.t +++ b/t/img.t @@ -15,7 +15,7 @@ use warnings; use strict; use Test::More; plan(skip_all => "Image::Magick not available") - unless eval q{use Image::Magick}; + unless eval q{use Image::Magick; 1}; use IkiWiki; @@ -38,6 +38,9 @@ push @command, qw(--set usedirs=0 --plugin img t/tmp/in t/tmp/out --verbose); my $magick = new Image::Magick; my $SVGS_WORK = defined $magick->QueryFormat("svg"); +$magick->Read("t/img/twopages.pdf"); +my $PDFS_WORK = defined $magick->Get("width"); + ok(! system("rm -rf t/tmp; mkdir -p t/tmp/in")); ok(! system("cp t/img/redsquare.png t/tmp/in/redsquare.png")); @@ -48,7 +51,7 @@ ok(! system("cp t/img/redsquare.png t/tmp/in/a:b:c:d.png")); ok(! system("cp t/img/redsquare.png t/tmp/in/a:b:c:d:e:f:g:h:i:j.png")); if ($SVGS_WORK) { - writefile("emptysquare.svg", "t/tmp/in", + writefile("bluesquare.svg", "t/tmp/in", ''); } @@ -57,7 +60,15 @@ ok(! system("cp t/img/twopages.pdf t/tmp/in/twopages.pdf")); my $maybe_svg_img = ""; if ($SVGS_WORK) { - $maybe_svg_img = "[[!img emptysquare.svg size=10x]]"; + $maybe_svg_img = "[[!img bluesquare.svg size=10x]]"; +} + +my $maybe_pdf_img = ""; +if ($PDFS_WORK) { + $maybe_pdf_img = <