ImageUploadValidator
final class ImageUploadValidator (View source)
| internal | UploadService supplies only sealed private snapshots and publishes only after this validator succeeds. |
Adds image decoding, detected-image MIME agreement, and dimension checks to the generic upload boundary.
Methods
Extends the generic extension and MIME boundary with image-specific content validation.
Validates an image snapshot and returns its detected MIME together with completely decoded pixels.
Fully decodes framework-generated output and verifies that encoding preserved its format and dimensions.
Details
__construct
__construct(FileUploadValidator $fileValidator, TranslatorInterface $translator, ImageProcessorInterface $imageProcessor)
Extends the generic extension and MIME boundary with image-specific content validation.
validate
ValidatedImageUpload
validate(StagedUpload $file, ImageUploadOptions $options)
Validates an image snapshot and returns its detected MIME together with completely decoded pixels.
The detected MIME must agree with both MimeTypeCatalog and decoded image metadata.
validateGenerated
DecodedImage
validateGenerated(StagedUpload $file, ImageFormat $expectedFormat, DecodedImage $source)
Fully decodes framework-generated output and verifies that encoding preserved its format and dimensions.