summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/graphviz.pm3
-rw-r--r--IkiWiki/Plugin/img.pm3
-rw-r--r--IkiWiki/Plugin/sparkline.pm3
3 files changed, 6 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index c91c92fec..dfd66a03e 100644
--- a/IkiWiki/Plugin/graphviz.pm
+++ b/IkiWiki/Plugin/graphviz.pm
@@ -71,7 +71,8 @@ sub render_graph (\%) {
writefile($dest, $config{destdir}, $png, 1);
}
else {
- # can't write the file, so embed it in a data uri
+ # in preview mode, embed the image in a data uri
+ # to avoid temp file clutter
eval q{use MIME::Base64};
error($@) if $@;
return "<img src=\"data:image/png;base64,".
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 63dfa9019..48211454e 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -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);
diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm
index 42665ac63..1b1d04cba 100644
--- a/IkiWiki/Plugin/sparkline.pm
+++ b/IkiWiki/Plugin/sparkline.pm
@@ -158,7 +158,8 @@ sub preprocess (@) {
writefile($fn, $config{destdir}, $png, 1);
}
else {
- # can't write the file, so embed it in a data uri
+ # in preview mode, embed the image in a data uri
+ # to avoid temp file clutter
eval q{use MIME::Base64};
error($@) if $@;
return "<img src=\"data:image/png;base64,".