]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/img.t
img: check magic number before giving common formats to ImageMagick
[git.ikiwiki.info.git] / t / img.t
diff --git a/t/img.t b/t/img.t
index 3d86db6baaf5672faddaa5f4a0f548837583a19f..5d0e0f09cdbc127eb264f99e0aae7645d1a92a09 100755 (executable)
--- a/t/img.t
+++ b/t/img.t
@@ -145,10 +145,15 @@ like($outhtml, qr{src="(\./)?imgconversions/11x-redsquare\.jpg" width="11" heigh
 like($outhtml, qr{src="(\./)?imgconversions/12x-redsquare\.jpeg" width="12" height="12"});
 
 # We do not misinterpret images
+my $quot = qr/(?:"|")/;
+like($outhtml, qr/${quot}really-svg\.png${quot} does not seem to be a valid png file/);
 ok(! -e "$outpath/666x-really-svg.png");
 ok(! -e "$outpath/666x-really-svg.bmp");
+like($outhtml, qr/${quot}really-pdf\.jpeg${quot} does not seem to be a valid jpeg file/);
 ok(! -e "$outpath/666x-really-pdf.jpeg");
+like($outhtml, qr/${quot}really-pdf\.jpg${quot} does not seem to be a valid jpeg file/);
 ok(! -e "$outpath/666x-really-pdf.jpg");
+like($outhtml, qr/${quot}really-pdf\.png${quot} does not seem to be a valid png file/);
 ok(! -e "$outpath/666x-really-pdf.png");
 
 # disable support for uncommon formats and try again