From 733debd9b37e0d9ba508ddf5d63c8d7411e24d98 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 10 Feb 2016 04:40:54 +0100 Subject: [PATCH] Use thumbnail upscaling config value --- classes/File.php | 5 +++-- lib/default.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/File.php b/classes/File.php index 145a01356c..6ba80eb5f6 100644 --- a/classes/File.php +++ b/classes/File.php @@ -416,7 +416,7 @@ class File extends Managed_DataObject * @throws UnsupportedMediaException if, despite trying, we can't understand how to make a thumbnail for this format * @throws ServerException on various other errors */ - public function getThumbnail($width=null, $height=null, $crop=false, $force_still=true) + public function getThumbnail($width=null, $height=null, $crop=false, $force_still=true, $upscale=null) { // Get some more information about this file through our ImageFile class $image = ImageFile::fromFileObject($this); @@ -428,7 +428,8 @@ class File extends Managed_DataObject } } - return $image->getFileThumbnail($width, $height, $crop); + return $image->getFileThumbnail($width, $height, $crop, + !is_null($upscale) ? $upscale : common_config('thumbnail', 'upscale')); } public function getPath() diff --git a/lib/default.php b/lib/default.php index dbd3a694c5..f90892e169 100644 --- a/lib/default.php +++ b/lib/default.php @@ -263,6 +263,7 @@ $default = 'maxsize' => 1000, // thumbs with an edge larger than this will not be generated 'width' => 450, 'height' => 600, + 'upscale' => false, 'animated' => false), // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin 'application' => array('desclimit' => null),