X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/14fb2ba91f744732303e5ed96ffeb625aeef03b4..8fa04f56fccf6a331a66eb896de1366522cd8562:/doc/bugs/image_rescaling_distorts_with_small_pictures.mdwn diff --git a/doc/bugs/image_rescaling_distorts_with_small_pictures.mdwn b/doc/bugs/image_rescaling_distorts_with_small_pictures.mdwn index 6eff2df07..a8c8deebf 100644 --- a/doc/bugs/image_rescaling_distorts_with_small_pictures.mdwn +++ b/doc/bugs/image_rescaling_distorts_with_small_pictures.mdwn @@ -10,3 +10,35 @@ If you use the rescaling feature of the directive [[ikiwiki/directive/img/]] wit > && ((width > desired width) || (height > desired height)), > it uses exactly the desired size, without preserving aspect ratio. > --smcv + +>> [[!template id=gitbranch branch=chrysn/imgforpdf-and-more author="[[chrysn]]"]] +>> +>> [[!tag patch]] +>> +>> i've implemented a fix for this along with a unit test. +>> +>> the patch branch is based on the imgforpdf branch +>> ([[bugs/svg and pdf conversion fails]]), because it would not cleanly merge. +>> the branch also enhances on how images are handled in preview, falling back +>> to data: urls if the image has not been rendered in a saved version. please +>> review. --[[chrysn]] + +>>> Mostly [[looks good to me|users/smcv/ready]]. +>>> +>>> Minor things, which wouldn't stop me merging it if I could: +>>> +>>> * `$imgdatalink = "data:image/".$im->Get("magick").";base64,".encode_base64($blob[0]);`: +>>> is the ImageMagick file type always valid as the second part of +>>> a MIME type? +>>> * In this code: +>>> +>>> +open (my $outhtmlfd, "<", "$outpath.html"); +>>> +local $/=undef; +>>> +my $outhtml = <$outhtmlfd>; +>>> +close $outhtmlfd; +>>> +>>> no block is closed, so the "local" is ineffective, so the `<>` operator +>>> remains in read-entire-file mode afterwards. To avoid odd side-effects, +>>> I would suggest using `readfile()` like `t/trail.t` does. +>>> +>>> --[[smcv]]