Image
Edit this pageWarning: You are browsing the documentation for Symfony 2.0, which is no longer maintained.
Read the updated version of this page for Symfony 6.3 (the current stable version).
Image
The Image constraint works exactly like the File constraint, except that its mimeTypes and `mimeTypesMessage` options are automatically setup to work for image files specifically.
See the File constraint for the bulk of the documentation on this constraint.
Options
This constraint shares all of its options with the File constraint. It does, however, modify two of the default option values:
mimeTypes
type: array
or string
default: an array of jpg, gif and png image mime types
You can find a list of existing image mime types on the IANA website
mimeTypesMessage
type: string
default: This file is not a valid image