]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/teximg.pm
web commit by XTaran: Changed case of repo link since hgweb seems to be pickier about...
[git.ikiwiki.info.git] / IkiWiki / Plugin / teximg.pm
index f7fd91ddf2a7156934a0a6c71ee52b1f294bea01..8c3e88c6974a8f2d5aa00fc119ba1f8941f4c943 100644 (file)
@@ -70,13 +70,13 @@ sub create ($$$) { #{{{
 
        my $digest = md5_hex($code, $height);
 
-       my $imglink= $params->{destpage} . "/$digest.png";
-       my $imglog =  $params->{destpage} .  "/$digest.log";
-       will_render($params->{destpage}, $imglink);
-       will_render($params->{destpage}, $imglog);
+       my $imglink= $params->{page} . "/$digest.png";
+       my $imglog =  $params->{page} .  "/$digest.log";
+       will_render($params->{page}, $imglink);
+       will_render($params->{page}, $imglog);
 
        my $imgurl=urlto($imglink, $params->{destpage});
-       my $logurl=urlto($imglink, $params->{destpage});
+       my $logurl=urlto($imglog, $params->{destpage});
        
        if (-e "$config{destdir}/$imglink" ||
            gen_image($code, $height, $digest, $params->{page})) {
@@ -119,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);