Skip to content

Documented the detectCorrupted and corruptedMessage options #6433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changed according to reviewers
  • Loading branch information
javiereguiluz committed May 3, 2016
commit d68c893e89c58a12c393e3fa45165c5e291277b7
11 changes: 6 additions & 5 deletions reference/constraints/Image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ detectCorrupted
.. versionadded:: 3.1
The ``detectCorrupted`` option was introduced in Symfony 3.1.

**type**: ``Boolean`` **default**: ``false``
**type**: ``boolean`` **default**: ``false``

If this option is true, the image contents are validated to ensure that the
image is not corrupted. This validation is done with PHP's ``imagecreatefromstring()``
function, which requires the PHP GD extension to be enabled.
image is not corrupted. This validation is done with PHP's :phpfunction:`imagecreatefromstring`
function, which requires the `PHP GD extension`_ to be enabled.

sizeNotDetectedMessage
~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -414,7 +414,8 @@ corruptedMessage

**type**: ``string`` **default**: ``The image file is corrupted.``

The error message if the image contents are corrupted and you set `detectCorrupted`_
to ``true``.
The error message when the `detectCorrupted`_ option is enabled and the image
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was to unsure to commit this, but shouldn't we use if here instead of when?

is corrupted.

.. _`IANA website`: http://www.iana.org/assignments/media-types/image/index.html
.. _`PHP GD extension`: http://php.net/manual/en/book.image.php