Use thumbnail upscaling config value

This commit is contained in:
Mikael Nordfeldth 2016-02-10 04:40:54 +01:00
parent 8806cce735
commit 733debd9b3
2 changed files with 4 additions and 2 deletions

View File

@ -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 UnsupportedMediaException if, despite trying, we can't understand how to make a thumbnail for this format
* @throws ServerException on various other errors * @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 // Get some more information about this file through our ImageFile class
$image = ImageFile::fromFileObject($this); $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() public function getPath()

View File

@ -263,6 +263,7 @@ $default =
'maxsize' => 1000, // thumbs with an edge larger than this will not be generated 'maxsize' => 1000, // thumbs with an edge larger than this will not be generated
'width' => 450, 'width' => 450,
'height' => 600, 'height' => 600,
'upscale' => false,
'animated' => false), // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin 'animated' => false), // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin
'application' => 'application' =>
array('desclimit' => null), array('desclimit' => null),