Skip to content

Instantly share code, notes, and snippets.

@bvibber
Created October 11, 2012 18:04
Show Gist options
  • Save bvibber/3874361 to your computer and use it in GitHub Desktop.
Save bvibber/3874361 to your computer and use it in GitHub Desktop.
iff --git a/includes/Linker.php b/includes/Linker.php
index f1f6c8e..0f45165 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -797,6 +797,7 @@ class Linker {
$hp['width'] = isset( $fp['upright'] ) ? 130 : 180;
}
$thumb = false;
+ $noscale = false;
if ( !$exists ) {
$outerWidth = $hp['width'] + 2;
@@ -815,6 +816,7 @@ class Linker {
} elseif ( isset( $fp['framed'] ) ) {
// Use image dimensions, don't scale
$thumb = $file->getUnscaledThumb( $hp );
+ $noscale = true;
} else {
# Do not present an image bigger than the source, for bitmap-style images
# This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour
@@ -848,7 +850,9 @@ class Linker {
$s .= wfMessage( 'thumbnail_error', '' )->escaped();
$zoomIcon = '';
} else {
- self::processResponsiveImages( $file, $thumb, $hp );
+ if ( !$noscale ) {
+ self::processResponsiveImages( $file, $thumb, $hp );
+ }
$params = array(
'alt' => $fp['alt'],
'title' => $fp['title'],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment