From fd257a9a3e3d0faa7a81992973483a434762ed06 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 20 Apr 2010 22:49:50 +0000 Subject: [PATCH] (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.) --- RELEASE-NOTES | 1 + includes/media/MediaTransformOutput.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7d4b282a75..7e5142eb74 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index e883325682..21a3f5d94d 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -215,10 +215,10 @@ class MediaTransformError extends MediaTransformOutput { } function toHtml( $options = array() ) { - return "width}px; height: {$this->height}px;\">
" . + return "
width}px; height: {$this->height}px; display:inline-block;\">" . $this->htmlMsg . - "
"; + ""; } 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' ) ); } } -- 2.20.1