class FileImageDimensionsConstraint

Same name in other branches
  1. 10 core/modules/file/src/Plugin/Validation/Constraint/FileImageDimensionsConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileImageDimensionsConstraint

File extension dimensions constraint.

Hierarchy

Expanded class hierarchy of FileImageDimensionsConstraint

File

core/modules/file/src/Plugin/Validation/Constraint/FileImageDimensionsConstraint.php, line 14

Namespace

Drupal\file\Plugin\Validation\Constraint
View source
class FileImageDimensionsConstraint extends SymfonyConstraint {
    
    /**
     * The minimum dimensions.
     *
     * @var string|int
     */
    public string|int $minDimensions = 0;
    
    /**
     * The maximum dimensions.
     *
     * @var string|int
     */
    public string|int $maxDimensions = 0;
    
    /**
     * The resized image too small message.
     *
     * @var string
     */
    public string $messageResizedImageTooSmall = 'The resized image is too small. The minimum dimensions are %dimensions pixels and after resizing, the image size will be %widthx%height pixels.';
    
    /**
     * The image too small message.
     *
     * @var string
     */
    public string $messageImageTooSmall = 'The image is too small. The minimum dimensions are %dimensions pixels and the image size is %widthx%height pixels.';
    
    /**
     * The resize failed message.
     *
     * @var string
     */
    public string $messageResizeFailed = 'The image exceeds the maximum allowed dimensions and an attempt to resize it failed.';

}

Members

Title Sort descending Modifiers Object type Summary
FileImageDimensionsConstraint::$maxDimensions public property The maximum dimensions.
FileImageDimensionsConstraint::$messageImageTooSmall public property The image too small message.
FileImageDimensionsConstraint::$messageResizedImageTooSmall public property The resized image too small message.
FileImageDimensionsConstraint::$messageResizeFailed public property The resize failed message.
FileImageDimensionsConstraint::$minDimensions public property The minimum dimensions.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.