mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
parent
6d1ae5e27c
commit
4965a77407
15 changed files with 48 additions and 211 deletions
|
@ -619,22 +619,20 @@ For each field, we describe the default widget used if you don't specify
|
|||
* Normalizes to: An ``UploadedFile`` object that wraps the file content
|
||||
and file name into a single object.
|
||||
* Validates that file data has been bound to the form, and that the
|
||||
file is of an image format understood by Pillow/PIL.
|
||||
file is of an image format understood by Pillow.
|
||||
* Error message keys: ``required``, ``invalid``, ``missing``, ``empty``,
|
||||
``invalid_image``
|
||||
|
||||
Using an ``ImageField`` requires that either `Pillow`_ (recommended) or the
|
||||
`Python Imaging Library`_ (PIL) are installed and supports the image
|
||||
formats you use. If you encounter a ``corrupt image`` error when you
|
||||
upload an image, it usually means either Pillow or PIL
|
||||
doesn't understand its format. To fix this, install the appropriate
|
||||
library and reinstall Pillow or PIL.
|
||||
Using an ``ImageField`` requires that `Pillow`_ is installed with support
|
||||
for the image formats you use. If you encounter a ``corrupt image`` error
|
||||
when you upload an image, it usually means that Pillow doesn't understand
|
||||
its format. To fix this, install the appropriate library and reinstall
|
||||
Pillow.
|
||||
|
||||
When you use an ``ImageField`` on a form, you must also remember to
|
||||
:ref:`bind the file data to the form <binding-uploaded-files>`.
|
||||
|
||||
.. _Pillow: http://python-imaging.github.io/Pillow/
|
||||
.. _Python Imaging Library: http://www.pythonware.com/products/pil/
|
||||
|
||||
``IntegerField``
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -841,9 +841,9 @@ optional arguments:
|
|||
Name of a model field which will be auto-populated with the width of the
|
||||
image each time the model instance is saved.
|
||||
|
||||
Requires the `Python Imaging Library`_.
|
||||
Requires the `Pillow`_ library.
|
||||
|
||||
.. _Python Imaging Library: http://www.pythonware.com/products/pil/
|
||||
.. _Pillow: http://python-imaging.github.io/Pillow/
|
||||
|
||||
By default, :class:`ImageField` instances are created as ``varchar(100)``
|
||||
columns in your database. As with other fields, you can change the maximum
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue