]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commit
img plugin: split resizing calculations and actual resizing
authorchrysn <chrysn@fsfe.org>
Mon, 14 Jul 2014 22:23:56 +0000 (00:23 +0200)
committerchrysn <chrysn@fsfe.org>
Tue, 15 Jul 2014 11:44:22 +0000 (13:44 +0200)
commita308b212ad697fb204fa8543d00c39a24f58de5f
tree4b8dce071cd9a44b6dc3cc4e4dde0c1a61e60b31
parent536a3364b2c2fe95ccb697502354c4ce24049cc5
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.
IkiWiki/Plugin/img.pm
t/img.t