public function getThumbnail(ImageInterface $image, ImageService $imageService)
{
if (!$this->fits($image)) {
throw new \InvalidArgumentException("Image is too small.");
}
list($width, $height) = \Newscoop\Image\ImageService::calculateSize($image->getWidth(), $image->getHeight(), $this->width, $this->height, $this->getFlags());
if ($this->isCrop()) {
$width = min($width, $this->width);
$height = min($height, $this->height);
}
return new Thumbnail($imageService->getSrc($image->getPath(), $this->width, $this->height, $this->getSpecs()), $width, $height);
}