/** * Adjusts the thumbnail dimensions. * * Dimensions passed in $requestedWidth and $requestedHeight * are adjusted to one of the allowed sizes. The smallest allowed * thumbnail size that is bigger than the requested one is used. */ protected function adjustDimensions() { $allowedSizes = $this->thumbnailRepository->getAllowedSizes(); $this->adjustedSizeInfo = end($allowedSizes); foreach ($allowedSizes as $sizeInfo) { if ($sizeInfo['width'] >= $this->requestedWidth && $sizeInfo['height'] >= $this->requestedHeight) { $this->adjustedSizeInfo = $sizeInfo; break; } } }