aboutsummaryrefslogtreecommitdiff
path: root/t/img.t
diff options
context:
space:
mode:
authorchrysn <chrysn@fsfe.org>2014-07-15 00:23:56 +0200
committerchrysn <chrysn@fsfe.org>2014-07-15 13:44:22 +0200
commita308b212ad697fb204fa8543d00c39a24f58de5f (patch)
tree4b8dce071cd9a44b6dc3cc4e4dde0c1a61e60b31 /t/img.t
parent536a3364b2c2fe95ccb697502354c4ce24049cc5 (diff)
downloadikiwiki-a308b212ad697fb204fa8543d00c39a24f58de5f.tar
ikiwiki-a308b212ad697fb204fa8543d00c39a24f58de5f.tar.gz
img plugin: split resizing calculations and actual resizing
there is now a size calculating part (which chooses a final size) and a scaling part (which triggers if the sizes calculated by the former indicate a downscaling). this solves the issue of unproportional upscalings (bugs/image_rescaling_distorts_with_small_pictures). also, "small" pdf files (or pdf files without explicit size settings), which would not be converted under the old mechanism, now get rendered to pngs. this commit affects a unit test: while svgs were previously unconditionally rendered to pngs, this now only happens on downscaling. this is intentional -- while a small version of an svg graphic is likely to be more compact when rendered (eg as a preview), a large version would not have that benefit, and why convert something that browsers basically can show and be inconsistend with how other images are handled. the new unit test simply makes the original svg larger to check for the same behaviros as before.
Diffstat (limited to 't/img.t')
-rwxr-xr-xt/img.t2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/img.t b/t/img.t
index c336c6744..0183f8779 100755
--- a/t/img.t
+++ b/t/img.t
@@ -21,7 +21,7 @@ BEGIN { use_ok("Image::Magick"); }
ok(! system("rm -rf t/tmp; mkdir -p t/tmp/in"));
ok(! system("cp t/img/redsquare.png t/tmp/in/redsquare.png"));
-writefile("emptysquare.svg", "t/tmp/in", '<svg width="10" height="10"/>');
+writefile("emptysquare.svg", "t/tmp/in", '<svg width="30" height="30"/>');
# using different image sizes for different pages, so the pagenumber selection can be tested easily
ok(! system("cp t/img/twopages.pdf t/tmp/in/twopages.pdf"));