X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0ccf21daafa76fd182df5e6bc156f22873fe062d..dcd57dd5c9f3265bb7a78a5696b90976698c43aa:/IkiWiki/Plugin/img.pm?ds=inline diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 63dfa9019..eb1b68124 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -39,7 +39,7 @@ sub preprocess (@) { } } - if (! exists $params{size}) { + if (! exists $params{size} || ! length $params{size}) { $params{size}='full'; } @@ -121,7 +121,8 @@ sub preprocess (@) { $r = $im->Resize(geometry => "${w}x${h}"); error sprintf(gettext("failed to resize: %s"), $r) if $r; - # don't actually write file in preview mode + # don't actually write resized file in preview mode; + # rely on width and height settings if (! $params{preview}) { my @blob = $im->ImageToBlob(); writefile($imglink, $config{destdir}, $blob[0], 1); @@ -155,14 +156,18 @@ sub preprocess (@) { $imgurl="$config{url}/$imglink"; } + my $attrs=''; + foreach my $attr (qw{alt title class id hspace vspace}) { + if (exists $params{$attr}) { + $attrs.=" $attr=\"$params{$attr}\""; + } + } + my $imgtag=''.$params{alt}.''; my $link;