Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

FileImageDimensionsConstraint.php

Namespace

Drupal\file\Plugin\Validation\Constraint

File

core/modules/file/src/Plugin/Validation/Constraint/FileImageDimensionsConstraint.php

View source
<?php

declare (strict_types=1);
namespace Drupal\file\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * File extension dimensions constraint.
 */
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.';

}

Classes

Title Deprecated Summary
FileImageDimensionsConstraint File extension dimensions constraint.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal