improve preview mode comments
authorJoey Hess <joey@kitenet.net>
Wed, 9 Jun 2010 21:43:20 +0000 (17:43 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 9 Jun 2010 21:43:20 +0000 (17:43 -0400)
IkiWiki/Plugin/graphviz.pm
IkiWiki/Plugin/img.pm
IkiWiki/Plugin/sparkline.pm

index c91c92fec72af9bbe4d4cf1c8a0f07f01e6933ec..dfd66a03e2250723132caa75c2f9d5da2e2c4fc2 100644 (file)
@@ -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,".
index 63dfa901909f358daf20a9975f00386749dcc747..48211454e93c1a65a5114241baccc207b1ac977b 100644 (file)
@@ -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);
index 42665ac63699efe2752dd177fdf1f998068aa418..1b1d04cba6e7c2e2510a51758a9cfd5439eb4ce5 100644 (file)
@@ -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,".