img: Fill in missing height or width when scaling image.
authorJoey Hess <joey@kitenet.net>
Wed, 9 Jun 2010 01:13:37 +0000 (21:13 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 9 Jun 2010 01:13:46 +0000 (21:13 -0400)
IkiWiki/Plugin/img.pm
debian/changelog
doc/bugs/img_plugin_and_missing_heigth_value.mdwn

index f06121578266bedc92027a0624cd05a21cdf6c0f..63dfa901909f358daf20a9975f00386749dcc747 100644 (file)
@@ -115,9 +115,6 @@ sub preprocess (@) {
                                $im = Image::Magick->new;
                                $r = $im->Read($outfile);
                                error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
-               
-                               $dwidth = $im->Get("width");
-                               $dheight = $im->Get("height");
                        }
                        else {
                                ($dwidth, $dheight)=($w, $h);
@@ -133,6 +130,9 @@ sub preprocess (@) {
                                        $imglink = $file;
                                }
                        }
+                       
+                       $dwidth = $im->Get("width") unless defined $dwidth;
+                       $dheight = $im->Get("height") unless defined $dheight;
                }
        }
        else {
index 0a7d17eb75c4aad563c4664bf4fc757797f17340..9a10332eaa6e252381f17a47e57c9824bbc954c6 100644 (file)
@@ -2,6 +2,7 @@ ikiwiki (3.20100518.3) UNRELEASED; urgency=low
 
   * creation_day() etc use local time, not gmtime. To match calendars, which
     use local time.
+  * img: Fill in missing height or width when scaling image.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 31 May 2010 20:44:17 -0400
 
index a82e2a7d7ff93a053d763dc62331d512edc4dd01..bcb17c33016b4880ff1b3b9ba7ae9783b1631dcc 100644 (file)
@@ -1,3 +1,5 @@
 When I set up my picture page with `\[[!img  defaults size=300x]]` then the html validator complains that the value for height is missing and the IE browsers won't show the pictures up at all; no problems with ff tho. If I set up my picture page with `\[[!img  defaults size=300x300]]` then all the images are funny stretched. What am I doing wrong?
 
 > This is a bug. --[[Joey]]
+
+> And .. [[fixed|done]] --[[Joey]]