ImageSizeConstrain
class ImageSizeConstrain implements PreProcessorInterface (View source)
Constants
PREPROCESSOR_PRIORITY |
|
Properties
private int|null | $maxWidth | Maximum image width (if set). |
|
private int|null | $maxHeight | Maximum image height (if set). |
|
private int | $constraintMode | Resize mode (one of the ImageInterface::THUMBNAIL_... constants). |
Methods
Get the maximum image width (if set).
Set the maximum image width.
Get the maximum image height (if set).
Set the maximum image height.
Get the resize mode.
Set the resize mode.
Get the priority of this pre-processor.
Check if this pre-processor should process a file being imported.
This function is a copy of the core thumbnail() function, modified to allow thumbnailing without making a copy in memory first as it is not always needed depending on the context.
Details
$this
readConfiguration(Repository $config)
Initialize the processor from the configured values.
int|null
getMaxWidth()
Get the maximum image width (if set).
$this
setMaxWidth(int|float|null $value)
Set the maximum image width.
int|null
getMaxHeight()
Get the maximum image height (if set).
$this
setMaxHeight(int|float|null $value)
Set the maximum image height.
int
getConstraintMode()
Get the resize mode.
$this
setConstraintMode(int $value)
Set the resize mode.
int
getPreProcessPriority()
Get the priority of this pre-processor.
bool
shouldPreProcess(ImportingFile $file, ImportOptions $options)
Check if this pre-processor should process a file being imported.
preProcess(ImportingFile $file, ImportOptions $options)
Pre-process a file being imported.
resizeInPlace(ImageInterface $image, Box $size, string $mode = ImageInterface::THUMBNAIL_INSET, string $filter = ImageInterface::FILTER_UNDEFINED)
This function is a copy of the core thumbnail() function, modified to allow thumbnailing without making a copy in memory first as it is not always needed depending on the context.