diff options
author | intrigeri <intrigeri@boum.org> | 2017-09-01 19:16:27 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2017-09-01 19:25:44 +0000 |
commit | 948bc22ae40527153b8b2abefd74e7da9901e0c0 (patch) | |
tree | 341bb16c2345816f7bdb51d41caf4cda98ba9e4d /t | |
parent | 258feb8bc82fd7f71a9005406eb15ddaf80b78ac (diff) | |
download | ikiwiki-948bc22ae40527153b8b2abefd74e7da9901e0c0.tar ikiwiki-948bc22ae40527153b8b2abefd74e7da9901e0c0.tar.gz |
t/img.t: test determinism of PNG resizing.
Diffstat (limited to 't')
-rwxr-xr-x | t/img.t | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -155,6 +155,19 @@ 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"); +# resize is deterministic when deterministic=1 +ok(utime(333333333, 333333333, "t/tmp/in/redsquare.png")); +ok(! system("rm $outpath/10x-redsquare.png")); +ok(! system(@command, '--set-yaml', 'img_allowed_formats=[JPEG, PNG, svg, pdf]', '--set', 'deterministic=1', "--rebuild")); +ok(! system("cp $outpath/10x-redsquare.png $outpath/10x-redsquare.png.orig")); +ok(utime(444444444, 444444444, "t/tmp/in/redsquare.png")); +ok(! system("rm $outpath/10x-redsquare.png")); +ok(! system(@command, '--set-yaml', 'img_allowed_formats=[JPEG, PNG, svg, pdf]', '--set', 'deterministic=1', "--rebuild")); +ok( + ! system("cmp $outpath/10x-redsquare.png $outpath/10x-redsquare.png.orig"), + "resize is deterministic when configured with deterministic=1" +); + # disable support for uncommon formats and try again ok(! system(@command, "--rebuild")); ok(! -e "$outpath/10x-bluesquare.png"); |