X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FFile.php;fp=classes%2FFile.php;h=b5bcec404168b8bbf9fbabfc3d58b69d6257ef93;hb=adf896bc12f7578196f3a93301e6777ef08174db;hp=9b703aa425ae25d9fc3b6e4c976b8fd778897151;hpb=3f9a16dc587b86b8912bc5a00dd1800c6475f73d;p=quix0rs-gnu-social.git diff --git a/classes/File.php b/classes/File.php index 9b703aa425..b5bcec4041 100644 --- a/classes/File.php +++ b/classes/File.php @@ -418,13 +418,6 @@ class File extends Managed_DataObject list($width, $height, $x, $y, $w2, $h2) = $image->scaleToFit($width, $height, $crop); - // Doublecheck that parameters are sane and integers. - if ($width < 1 || $width > common_config('thumbnail', 'maxsize') - || $height < 1 || $height > common_config('thumbnail', 'maxsize')) { - // Fail on bad width parameter. If this occurs, it's due to algorithm in ImageFile->scaleToFit - throw new ServerException('Bad thumbnail size parameters.'); - } - $params = array('file_id'=> $this->id, 'width' => $width, 'height' => $height); @@ -437,7 +430,9 @@ class File extends Managed_DataObject $outname = "thumb-{$width}x{$height}-" . $this->filename; $outpath = self::path($outname); - $image->resizeTo($outpath, $width, $height, $x, $y, $w2, $h2); + $image->resizeTo($outpath, array('width'=>$width, 'height'=>$height, + 'x'=>$x, 'y'=>$y, + 'w'=>$w2, 'h'=>$h2)); // Avoid deleting the original if ($image->getPath() != $this->getPath()) {