diff options
author | Joey Hess <joey@kitenet.net> | 2010-06-09 17:43:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-06-09 17:43:20 -0400 |
commit | b2327cfae4ac7da1df7bbf848f575b553f74eafb (patch) | |
tree | 52e3bb545fab95ac0be7711cb948d1967a9d901d | |
parent | 118750658885fa64a03c8860d8a3fe2573221276 (diff) |
improve preview mode comments
-rw-r--r-- | IkiWiki/Plugin/graphviz.pm | 3 | ||||
-rw-r--r-- | IkiWiki/Plugin/img.pm | 3 | ||||
-rw-r--r-- | IkiWiki/Plugin/sparkline.pm | 3 |
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,". |