* Have a checkered background on images on the description pages and in
galeries to make transparency visible (just MonoBook for now, will add the
rest soon).
+* (bug 7782) Standardisation of file info at image description pages.
== Languages updated ==
* Slovak (sk)
* Swedish (sv)
* Zealandic (zea)
+* Cantonese (zh-yue)
== Compatibility ==
} else {
$page = 1;
}
- $width = $this->img->getWidth();
- $height = $this->img->getHeight();
+ $width_orig = $this->img->getWidth();
+ $width = $width_orig;
+ $height_orig = $this->img->getHeight();
+ $height = $height_orig;
+ $mime = $this->img->getMimeType();
$showLink = false;
if ( $this->img->allowInlineDisplay() and $width and $height) {
# image
# "Download high res version" link below the image
- $msg = wfMsgHtml('showbigimage', $width, $height, intval( $this->img->getSize()/1024 ) );
-
+ $msgbig = wfMsgHtml('show-big-image');
+ $msgsize = wfMsgHtml('file-info-size', $width_orig, $height_orig, $sk->formatSize( $this->img->getSize() ), $mime );
# We'll show a thumbnail of this image
if ( $width > $maxWidth || $height > $maxHeight ) {
# Calculate the thumbnail size.
if( $this->img->mustRender() ) {
$showLink = true;
} else {
- $anchorclose .= "\n$anchoropen{$msg}</a>";
+ $anchorclose .= wfMsg('show-big-image-thumb', $width, $height ) .
+ '<br />' . "\n$anchoropen{$msgbig}</a> " . $msgsize;
}
} else {
$url = $this->img->getViewURL();
// Hacky workaround: for some reason we use the incorrect MIME type
// image/svg for SVG. This should be fixed internally, but at least
// make the displayed type right.
- $mime = $this->img->getMimeType();
if ($mime == 'image/svg') $mime = 'image/svg+xml';
-
- $info = wfMsg( 'fileinfo',
- ceil($this->img->getSize()/1024.0),
- $mime );
+ // Check for MIME type. Other types may have more information in the future.
+ $infores = '';
+ if ( substr($mime,0,5) == 'image' ) {
+ $infores = wfMsg('file-nohires') . '<br />';
+ $info = wfMsg(
+ 'file-info-size',
+ $width_orig, $height_orig,
+ $sk->formatSize( $this->img->getSize() ),
+ $mime );
+ } else {
+ $info = wfMsg(
+ 'file-info',
+ $sk->formatSize( $this->img->getSize() ),
+ $mime );
+ }
global $wgContLang;
$dirmark = $wgContLang->getDirMark();
if (!$this->img->isSafeFile()) {
$warning = wfMsg( 'mediawarning' );
$wgOut->addWikiText( <<<END
-<div class="fullMedia">
+<div class="fullMedia">$infores
<span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark
-<span class="fileInfo"> ($info)</span>
+<span class="fileInfo"> $info</span>
</div>
<div class="mediaWarning">$warning</div>
);
} else {
$wgOut->addWikiText( <<<END
-<div class="fullMedia">
-[[Media:$filename|$filename]]$dirmark <span class="fileInfo"> ($info)</span>
+<div class="fullMedia">$infores
+[[Media:$filename|$filename]]$dirmark <span class="fileInfo"> $info</span>
</div>
END
);
*/
public function formatSize( $size ) {
global $wgLang;
+ // For small sizes no decimal places necessary
+ $round = 0;
if( $size > 1024 ) {
$size = $size / 1024;
if( $size > 1024 ) {
$size = $size / 1024;
+ // For MB and bigger two decimal places are smarter
+ $round = 2;
if( $size > 1024 ) {
$size = $size / 1024;
$msg = 'size-gigabytes';
} else {
$msg = 'size-bytes';
}
- $size = round( $size, 0 );
+ $size = round( $size, $round );
return wfMsgHtml( $msg, $wgLang->formatNum( $size ) );
}
'previousdiff' => '← Zum vorherigen Versionsunterschied',
'nextdiff' => 'Zum nächsten Versionsunterschied →',
-'imagemaxsize' => 'Maximale Bildgröße auf Bildbeschreibungsseiten:',
-'thumbsize' => 'Standardgröße der Vorschaubilder (thumbnails):',
-'showbigimage' => 'Version mit hoher Auflösung herunterladen ($1 x $2 Pixel, $3 kB)',
-
'newimages' => 'Neue Dateien',
'newimages-summary' => 'Diese Spezialseite zeigt die zuletzt hochgeladenen Bilder und Dateien an.',
'showhidebots' => '(Bots $1)',
'passwordtooshort' => 'Das Passwort ist zu kurz. Es muss mindestens $1 Zeichen lang sein.',
-# Media Warning
-'mediawarning' => "'''Warnung:''' Diese Art von Datei kann böswilligen Programmcode enthalten. Durch das Herunterladen oder Öffnen der Datei kann Ihr Computer beschädigt werden.<hr />",
-
-'fileinfo' => '$1 kB, MIME Typ: <code>$2</code>',
+# Media-info
+'mediawarning' => "'''Warnung:''' Diese Art von Datei kann böswilligen Programmcode enthalten. Durch das Herunterladen und Öffnen der Datei kann Ihr Computer beschädigt werden.<hr />",
+'imagemaxsize' => 'Maximale Bildgröße auf Bildbeschreibungsseiten:',
+'thumbsize' => 'Standardgröße der Vorschaubilder (thumbnails):',
+'widthheight' => '$1×$2',
+'file-info' => 'Dateigröße: $1, MIME-Typ: $2',
+'file-info-size' => '($1 × $2 Pixel, Dateigröße: $3, MIME-Typ: $4)',
+'file-nohires' => '<small>Keine höhere Auflösung vorhanden.</small>',
+'show-big-image' => 'Version in höherer Auflösung',
+'show-big-image-thumb' => '<small>Größe der Voransicht: $1 × $2 Pixel</small>',
# Metadata
'metadata' => 'Metadaten',
'versionrequired' => 'Version $1 of MediaWiki required',
'versionrequiredtext' => 'Version $1 of MediaWiki is required to use this page. See [[Special:Version|version page]].',
-'widthheight' => '$1×$2',
'ok' => 'OK',
'sitetitle' => '{{SITENAME}}',
'pagetitle' => '$1 - {{SITENAME}}',
'previousdiff' => '← Previous diff',
'nextdiff' => 'Next diff →',
-'imagemaxsize' => 'Limit images on image description pages to:',
-'thumbsize' => 'Thumbnail size:',
-'showbigimage' => 'Download high resolution version ($1x$2, $3 KB)',
+# media-info
+'mediawarning' => "'''Warning''': This file may contain malicious code, by executing it your system may be compromised.<hr />",
+'imagemaxsize' => 'Limit images on image description pages to:',
+'thumbsize' => 'Thumbnail size:',
+'widthheight' => '$1×$2',
+'file-info' => 'File size: $1, MIME type: $2',
+'file-info-size' => '($1 × $2 pixel, file size: $3, MIME type: $4)',
+'file-nohires' => '<small>No higher resolution available.</small>',
+'show-big-image' => 'Image in higher resolution',
+'show-big-image-thumb' => '<small>Size of this preview: $1 × $2 pixel</small>',
'newimages' => 'Gallery of new files',
'newimages-summary' => '',
'passwordtooshort' => 'Your password is too short. It must have at least $1 characters.',
-# Media Warning
-'mediawarning' => '\'\'\'Warning\'\'\': This file may contain malicious code, by executing it your system may be compromised.<hr />',
-
-'fileinfo' => '$1KB, MIME type: <code>$2</code>',
-
# Metadata
'metadata' => 'Metadata',
'metadata-help' => 'This file contains additional information, probably added from the digital camera or scanner used to create or digitize it. If the file has been modified from its original state, some details may not fully reflect the modified image.',
'versionrequiredtext',
),
'miscellaneous3' => array(
- 'widthheight',
'ok',
'sitetitle',
'pagetitle',
'previousdiff',
'nextdiff',
),
- 'imagesize' => array(
+ 'media-info' => array(
+ 'mediawarning',
'imagemaxsize',
'thumbsize',
- 'showbigimage',
+ 'widthheight',
+ 'file-info',
+ 'file-info-size',
+ 'file-nohires',
+ 'show-big-image',
+ 'show-big-image-thumb',
),
'newimages' => array(
'newimages',
'passwordtooshort' => array(
'passwordtooshort',
),
- 'mediawarning' => array(
- 'mediawarning',
- ),
- 'fileinfo' => array(
- 'fileinfo',
- ),
'metadata' => array(
'metadata',
'metadata-help',
'patrol-log' => 'Patrol log',
'imagedeletion' => 'Image deletion',
'browsediffs' => 'Browsing diffs',
- 'imagesize' => '',
'newimages' => '',
'variantname-zh' => "Short names for language variants used for language conversion links.
To disable showing a particular link, set it to 'disable', e.g.
'variantname-kk' => 'Variants for Kazakh language',
'specialloglabels' => 'Labels for User: and Title: on Special:Log pages',
'passwordtooshort' => '',
- 'mediawarning' => 'Media Warning',
- 'fileinfo' => '',
+ 'media-info' => 'Media information',
'metadata' => 'Metadata',
'exif' => 'EXIF tags',
'exif-values' => 'Make & model, can be wikified in order to link to the camera and model name',