diff --git a/extensions/wikia/Recirculation/RailContentService.php b/extensions/wikia/Recirculation/RailContentService.php index e90afdb47e71..66251861f4c2 100644 --- a/extensions/wikia/Recirculation/RailContentService.php +++ b/extensions/wikia/Recirculation/RailContentService.php @@ -17,7 +17,7 @@ public function renderRailModule() { try { $articles[$pageId]['thumbnail'] = VignetteRequest::fromUrl( $article['thumbnail'] ) - ->zoomCrop() + ->smart() ->width( static::RAIL_THUMBNAIL_WIDTH ) ->height( static::RAIL_THUMBNAIL_HEIGHT ) ->url(); diff --git a/extensions/wikia/Recirculation/js/recirculation.js b/extensions/wikia/Recirculation/js/recirculation.js index 4e7cf4579552..1636eb443437 100644 --- a/extensions/wikia/Recirculation/js/recirculation.js +++ b/extensions/wikia/Recirculation/js/recirculation.js @@ -192,7 +192,7 @@ require([ if (sponsoredItem.thumbnailUrl && window.Vignette) { sponsoredItem.thumbnailUrl = window.Vignette.getThumbURL(sponsoredItem.thumbnailUrl, { - mode: window.Vignette.mode.zoomCrop, + mode: window.Vignette.mode.smart, height: 53, width: 53 }); diff --git a/lib/Wikia/src/Vignette/UrlGenerator.php b/lib/Wikia/src/Vignette/UrlGenerator.php index dc9cc997cba6..0a6e92c25d66 100644 --- a/lib/Wikia/src/Vignette/UrlGenerator.php +++ b/lib/Wikia/src/Vignette/UrlGenerator.php @@ -21,6 +21,8 @@ class UrlGenerator { const MODE_WINDOW_CROP_FIXED = 'window-crop-fixed'; const MODE_ZOOM_CROP = 'zoom-crop'; const MODE_ZOOM_CROP_DOWN = 'zoom-crop-down'; + const MODE_SMART = 'smart'; + const IMAGE_TYPE_AVATAR = 'avatars'; const IMAGE_TYPE_IMAGES = 'images'; @@ -243,6 +245,10 @@ public function windowCropFixed() { return $this->mode(self::MODE_WINDOW_CROP_FIXED); } + public function smart() { + return $this->mode( self::MODE_SMART ); + } + /** * Force the thumbnail request to replace the cached thumbnail. * diff --git a/resources/wikia/libraries/vignette/vignette.js b/resources/wikia/libraries/vignette/vignette.js index 1202bfe28af5..25309c6edfd7 100644 --- a/resources/wikia/libraries/vignette/vignette.js +++ b/resources/wikia/libraries/vignette/vignette.js @@ -291,6 +291,7 @@ var Vignette = (function () { fixedAspectRatio: 'fixed-aspect-ratio', fixedAspectRatioDown: 'fixed-aspect-ratio-down', scaleToWidth: 'scale-to-width', + smart: 'smart', thumbnail: 'thumbnail', thumbnailDown: 'thumbnail-down', topCrop: 'top-crop',