From b2327cfae4ac7da1df7bbf848f575b553f74eafb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 17:43:20 -0400 Subject: improve preview mode comments --- IkiWiki/Plugin/graphviz.pm | 3 ++- IkiWiki/Plugin/img.pm | 3 ++- IkiWiki/Plugin/sparkline.pm | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'IkiWiki') 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 "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 "