]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
(no commit message)
authorhttps://www.google.com/accounts/o8/id?id=AItOawlUtmRueCOLddksWZN8zOVnseVrtRSxM58 <Per@web>
Thu, 17 Nov 2011 21:29:28 +0000 (17:29 -0400)
committeradmin <admin@branchable.com>
Thu, 17 Nov 2011 21:29:28 +0000 (17:29 -0400)
doc/bugs/resized_img_with_only_width_or_height_breaks_ie.mdwn

index 2ab1fee366595401b5e0110116e125c04634ed83..c8196b412057dbf2dc17f3466453247eecd8c1bd 100644 (file)
@@ -4,3 +4,22 @@ In those cases img plugin do generate HTML with the missing attribute as "empty"
 
 If we instead always get the resulting the width and height from the resized image, and uses those values in the img attrs, we make IE happy (and all other renders as well).
 
+Inline patch:
+
+diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
+index b98e843..398e9bc 100644
+--- a/IkiWiki/Plugin/img.pm
++++ b/IkiWiki/Plugin/img.pm
+@@ -132,9 +132,9 @@ sub preprocess (@) {
+                                        $imglink = $file;
+                                }
+                        }
+-
+-                       $dwidth = $im->Get("width") unless defined $dwidth;
+-                       $dheight = $im->Get("height") unless defined $dheight;
++                       # get true image width and height from resized image attributes
++                       $dwidth  = $im->Get("width");
++                       $dheight = $im->Get("height");
+                }
+        }
+        else {