r65350 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65349‎ | r65350 | r65351 >
Date:22:49, 20 April 2010
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
(bug 23075) correct MediaTransformError default width in gallery. Contributed by Derk-Jan Hartman.

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.)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/media/MediaTransformOutput.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/MediaTransformOutput.php
@@ -215,10 +215,10 @@
216216 }
217217
218218 function toHtml( $options = array() ) {
219 - return "<table class=\"MediaTransformError\" style=\"" .
220 - "width: {$this->width}px; height: {$this->height}px;\"><tr><td>" .
 219+ return "<div class=\"MediaTransformError\" style=\"" .
 220+ "width: {$this->width}px; height: {$this->height}px; display:inline-block;\">" .
221221 $this->htmlMsg .
222 - "</td></tr></table>";
 222+ "</div>";
223223 }
224224
225225 function toText() {
@@ -242,8 +242,8 @@
243243 class TransformParameterError extends MediaTransformError {
244244 function __construct( $params ) {
245245 parent::__construct( 'thumbnail_error',
246 - max( isset( $params['width'] ) ? $params['width'] : 0, 180 ),
247 - max( isset( $params['height'] ) ? $params['height'] : 0, 180 ),
 246+ max( isset( $params['width'] ) ? $params['width'] : 0, 120 ),
 247+ max( isset( $params['height'] ) ? $params['height'] : 0, 120 ),
248248 wfMsg( 'thumbnail_invalid_params' ) );
249249 }
250250 }
Index: trunk/phase3/RELEASE-NOTES
@@ -119,6 +119,7 @@
120120 * (bug 17941) $wgMaxUploadSize is now honored by all upload sources
121121 * (bug 23080) New usernames now limited to 235 bytes so that custom skin files
122122 work.
 123+* (bug 23075) Correct MediaTransformError default width in gallery.
123124
124125 === API changes in 1.17 ===
125126 * (bug 22738) Allow filtering by action type on query=logevent

Comments

#Comment by Werdna (talk | contribs)   01:19, 9 December 2010

Looks OK to me.

Status & tagging log