Public Member Functions | |
__construct (CKFinder $app) | |
getResizedImage (ResourceType $sourceFileResourceType, string $sourceFileDir, string $sourceFileName, int $requestedWidth, int $requestedHeight) | |
getExistingResizedImage (ResourceType $sourceFileResourceType, string $sourceFileDir, string $sourceFileName, string $thumbnailFileName) | |
getContainer () | |
deleteResizedImages (ResourceType $sourceFileResourceType, string $sourceFilePath, string $sourceFileName) | |
copyResizedImages (ResourceType $sourceFileResourceType, string $sourceFilePath, string $sourceFileName, ResourceType $targetFileResourceType, string $targetFilePath, string $targetFileName) | |
renameResizedImages (ResourceType $sourceFileResourceType, string $sourceFilePath, string $originalSourceFileName, string $newSourceFileName) | |
getResizedImagesList (ResourceType $sourceFileResourceType, string $sourceFilePath, string $sourceFileName, array $filterSizes=[]) | |
getResizedImageBySize (ResourceType $sourceFileResourceType, string $sourceFilePath, string $sourceFileName, int $width, int $height) | |
Protected Member Functions | |
isSizeAllowedInConfig (int $width, int $height) | |
getSizeNameFromConfig (int $width, int $height) | |
createNodeValue ($resizedImage) | |
sortImagesBySize (array $custom) | |
Protected Attributes | |
$app | |
$config | |
$acl | |
$dispatcher | |
The ThumbnailRepository class.
A class responsible for resized image management that simplifies operations on resized versions of the image file, like batch renaming/moving together with the original file.
copyResizedImages | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFilePath, | ||
string | $sourceFileName, | ||
ResourceType | $targetFileResourceType, | ||
string | $targetFilePath, | ||
string | $targetFileName | ||
) |
Copies all resized images for a given file.
FilesystemException |
deleteResizedImages | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFilePath, | ||
string | $sourceFileName | ||
) |
Deletes all resized images for a given file.
true
if deleted getExistingResizedImage | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFileDir, | ||
string | $sourceFileName, | ||
string | $thumbnailFileName | ||
) |
Returns an existing resized image.
FileNotFoundException | |
FilesystemException | |
Exception |
getResizedImage | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFileDir, | ||
string | $sourceFileName, | ||
int | $requestedWidth, | ||
int | $requestedHeight | ||
) |
Returns a resized image for the provided source file.
If an appropriate resized version already exists, it is reused.
FileNotFoundException | |
UnauthorizedException |
getResizedImageBySize | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFilePath, | ||
string | $sourceFileName, | ||
int | $width, | ||
int | $height | ||
) |
FilesystemException | |
Exception |
getResizedImagesList | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFilePath, | ||
string | $sourceFileName, | ||
array | $filterSizes = [] |
||
) |
Returns a list of resized images generated for a given file.
ResourceType | $sourceFileResourceType | source file resource type |
string | $sourceFilePath | source file backend-relative path |
string | $sourceFileName | source file name |
array | $filterSizes | array containing names of sizes defined in the images.sizes configuration |
FilesystemException |
|
protected |
Returns the size name defined in the configuration, where width or height are equal to those given in parameters.
Resized images keep the original image aspect ratio. When an image is resized using the size from the configuration, at least one of the borders has the same length.
|
protected |
Checks if the provided image size is allowed in the configuration.
This is checked when Permission::IMAGE_RESIZE_CUSTOM
is not allowed in the source file folder.
true
if the provided size is allowed in the configuration renameResizedImages | ( | ResourceType | $sourceFileResourceType, |
string | $sourceFilePath, | ||
string | $originalSourceFileName, | ||
string | $newSourceFileName | ||
) |
Renames all resized images created for a given file.
FilesystemException |
|
protected |
Event dispatcher.