Xpressengine\Media\Handlers\ImageHandler::createThumbnails PHP Method

createThumbnails() public method

Create thumbnail images
public createThumbnails ( string $origin, Xpressengine\Media\Commands\CommandInterface $command, null | string $code = null, null | string $disk = null, null | string $path = null, null | string $originId = null ) : Image
$origin string image content
$command Xpressengine\Media\Commands\CommandInterface executable command
$code null | string dimension code
$disk null | string storage disk
$path null | string saved path
$originId null | string origin file id
return Xpressengine\Media\Models\Image
    public function createThumbnails($origin, CommandInterface $command, $code = null, $disk = null, $path = null, $originId = null)
    {
        $thumbnailer = $this->makeThumbnailer();
        $content = $thumbnailer->setOrigin($origin)->addCommand($command)->generate();
        $file = $this->storage->create($content, $path ?: '', implode('_', [$command->getName(), $command->getDimension()->getWidth() . 'x' . $command->getDimension()->getHeight(), hash('sha1', $content)]), $disk, $originId);
        return $this->make($file, ['type' => $command->getName(), 'code' => $code]);
    }