(bug 23075) correct MediaTransformError default width in gallery. Contributed by...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Tue, 20 Apr 2010 22:49:50 +0000 (22:49 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Tue, 20 Apr 2010 22:49:50 +0000 (22:49 +0000)
Submitter's remarks:
This patch changes the minimum size of a MediaTransformError to 120px, which
makes sure it will at least fit galleries. Any smaller and likely it would
become unreadable, so keep the ugly in those cases.

The patch also changes the message from a table to a div, because there is no
real need to use a table here. I have added "display:inline-block" to the css
to make it behave almost exactly as an img or table element would (This might
be important for [[File:image.gif|180px]], where no other framing is provided.)

RELEASE-NOTES
includes/media/MediaTransformOutput.php

index 7d4b282..7e5142e 100644 (file)
@@ -119,6 +119,7 @@ in a negative namespace (which is invalid).
 * (bug 17941) $wgMaxUploadSize is now honored by all upload sources
 * (bug 23080) New usernames now limited to 235 bytes so that custom skin files
   work.
+* (bug 23075) Correct MediaTransformError default width in gallery.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent
index e883325..21a3f5d 100644 (file)
@@ -215,10 +215,10 @@ class MediaTransformError extends MediaTransformOutput {
        }
 
        function toHtml( $options = array() ) {
-               return "<table class=\"MediaTransformError\" style=\"" .
-                       "width: {$this->width}px; height: {$this->height}px;\"><tr><td>" .
+               return "<div class=\"MediaTransformError\" style=\"" .
+                       "width: {$this->width}px; height: {$this->height}px; display:inline-block;\">" .
                        $this->htmlMsg .
-                       "</td></tr></table>";
+                       "</div>";
        }
 
        function toText() {
@@ -242,8 +242,8 @@ class MediaTransformError extends MediaTransformOutput {
 class TransformParameterError extends MediaTransformError {
        function __construct( $params ) {
                parent::__construct( 'thumbnail_error',
-                       max( isset( $params['width']  ) ? $params['width']  : 0, 180 ),
-                       max( isset( $params['height'] ) ? $params['height'] : 0, 180 ),
+                       max( isset( $params['width']  ) ? $params['width']  : 0, 120 ),
+                       max( isset( $params['height'] ) ? $params['height'] : 0, 120 ),
                        wfMsg( 'thumbnail_invalid_params' ) );
        }
 }