Merge "ToC: Use display:table, so that we can behave like a block element"
[lhc/web/wiklou.git] / includes / media / MediaTransformOutput.php
index 8632399..c49d3f2 100644 (file)
@@ -209,7 +209,7 @@ abstract class MediaTransformOutput {
                if ( $this->page && $this->page !== 1 ) {
                        $query['page'] = $this->page;
                }
-               if( $this->lang ) {
+               if ( $this->lang ) {
                        $query['lang'] = $this->lang;
                }
 
@@ -298,6 +298,8 @@ class ThumbnailImage extends MediaTransformOutput {
         *     valign       vertical-align property, if the output is an inline element
         *     img-class    Class applied to the \<img\> tag, if there is such a tag
         *     desc-query   String, description link query params
+        *     override-width     Override width attribute. Should generally not set
+        *     override-height    Override height attribute. Should generally not set
         *     custom-url-link    Custom URL to link to
         *     custom-title-link  Custom Title object to link to
         *     custom target-link Value of the target attribute, for custom-target-link
@@ -359,6 +361,12 @@ class ThumbnailImage extends MediaTransformOutput {
                if ( !empty( $options['img-class'] ) ) {
                        $attribs['class'] = $options['img-class'];
                }
+               if ( isset( $options['override-height'] ) ) {
+                       $attribs['height'] = $options['override-height'];
+               }
+               if ( isset( $options['override-width'] ) ) {
+                       $attribs['width'] = $options['override-width'];
+               }
 
                // Additional densities for responsive images, if specified.
                if ( !empty( $this->responsiveUrls ) ) {