X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/85de2f7bc4d00a4a4711cd91224553beae411532..9c6444bf681ec48e3832282906d1d2cfad586cb5:/IkiWiki/Plugin/teximg.pm?ds=inline diff --git a/IkiWiki/Plugin/teximg.pm b/IkiWiki/Plugin/teximg.pm index 5dff5feef..8c3e88c69 100644 --- a/IkiWiki/Plugin/teximg.pm +++ b/IkiWiki/Plugin/teximg.pm @@ -72,19 +72,11 @@ sub create ($$$) { #{{{ my $imglink= $params->{page} . "/$digest.png"; my $imglog = $params->{page} . "/$digest.log"; - will_render($params->{destpage}, $imglink); - will_render($params->{destpage}, $imglog); - - my $imgurl; - my $logurl; - if (! $params->{preview}) { - $imgurl = urlto($imglink, $params->{destpage}); - $logurl = urlto($imglog, $params->{destpage}); - } - else { - $imgurl=$params->{page}."/$digest.png"; - $logurl=$params->{page}."/$digest.log"; - } + will_render($params->{page}, $imglink); + will_render($params->{page}, $imglog); + + my $imgurl=urlto($imglink, $params->{destpage}); + my $logurl=urlto($imglog, $params->{destpage}); if (-e "$config{destdir}/$imglink" || gen_image($code, $height, $digest, $params->{page})) { @@ -127,12 +119,13 @@ sub gen_image ($$$$) { #{{{ } else { # store failure log - my $log; + my $log=""; { - open(my $f, '<', "$tmp/$digest.log"); - local $/=undef; - $log = <$f>; - close($f); + if (open(my $f, '<', "$tmp/$digest.log")) { + local $/=undef; + $log = <$f>; + close($f); + } } writefile("$digest.log", "$config{destdir}/$imagedir", $log);