@@ -9,9 +9,9 @@ Additionally it has options so you can validate against the width and height
9
9
of the image.
10
10
11
11
.. versionadded :: 2.4
12
- As of Symfony 2.4 you can also validate against the image aspect ratio ( defined
13
- as ``width / height ``) and selectively allow square, landscape and portrait
14
- image orientations.
12
+ As of Symfony 2.4 you can also validate against the image aspect ratio
13
+ (defined as ``width / height ``) and selectively allow square, landscape
14
+ and portrait image orientations.
15
15
16
16
See the :doc: `File</reference/constraints/File> ` constraint for the bulk of
17
17
the documentation on this constraint.
@@ -284,47 +284,49 @@ value in pixels.
284
284
maxRatio
285
285
~~~~~~~~
286
286
287
- **type **: ``integer ``
287
+ **type **: ``float ``
288
288
289
- If set, the aspect ratio (``width / height ``) of the image file must be less than or equal to this
290
- value.
289
+ If set, the aspect ratio (``width / height ``) of the image file must be less
290
+ than or equal to this value.
291
291
292
292
minRatio
293
293
~~~~~~~~
294
294
295
- **type **: ``integer ``
295
+ **type **: ``float ``
296
296
297
- If set, the aspect ratio (``width / height ``) of the image file must be greater than or equal to this
298
- value.
297
+ If set, the aspect ratio (``width / height ``) of the image file must be greater
298
+ than or equal to this value.
299
299
300
300
allowSquare
301
301
~~~~~~~~~~~
302
302
303
303
**type **: ``Boolean `` **default **: ``true ``
304
304
305
- If this option is false, the image must not be square.
305
+ If this option is false, the image cannot be a square. If you want to force
306
+ a square image, then set leave this option as its default ``true `` value
307
+ and set `allowLandscape `_ and `allowPortrait `_ both to ``false ``.
306
308
307
309
allowLandscape
308
310
~~~~~~~~~~~~~~
309
311
310
312
**type **: ``Boolean `` **default **: ``true ``
311
313
312
- If this option is false, the image must not be landscape oriented.
314
+ If this option is false, the image cannot be landscape oriented.
313
315
314
316
allowPortrait
315
317
~~~~~~~~~~~~~
316
318
317
319
**type **: ``Boolean `` **default **: ``true ``
318
320
319
- If this option is false, the image must not be portrait oriented.
321
+ If this option is false, the image cannot be portrait oriented.
320
322
321
323
sizeNotDetectedMessage
322
324
~~~~~~~~~~~~~~~~~~~~~~
323
325
324
326
**type **: ``string `` **default **: ``The size of the image could not be detected ``
325
327
326
328
If the system is unable to determine the size of the image, this error will
327
- be displayed. This will only occur when at least one of the four size constraint
329
+ be displayed. This will only occur when at least one of the size constraint
328
330
options has been set.
329
331
330
332
maxWidthMessage
@@ -397,6 +399,6 @@ allowPortraitMessage
397
399
**type **: ``string `` **default **: ``The image is portrait oriented ({{ width }}x{{ height }}px).
398
400
Portrait oriented images are not allowed ``
399
401
400
- The error message if the image is portrait oriented and you set `allowPoirtrait `_ to ``false ``.
402
+ The error message if the image is portrait oriented and you set `allowPortrait `_ to ``false ``.
401
403
402
404
.. _`IANA website` : http://www.iana.org/assignments/media-types/image/index.html
0 commit comments