mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-02 14:34:04 +03:00
Merge pull request #1252 from thedrow/patch-3
Recommend using Pillow instead of PIL.
This commit is contained in:
commit
6ceb0fa94a
|
@ -286,7 +286,7 @@ An image representation.
|
||||||
|
|
||||||
Corresponds to `django.forms.fields.ImageField`.
|
Corresponds to `django.forms.fields.ImageField`.
|
||||||
|
|
||||||
Requires the `PIL` package.
|
Requires either the `Pillow` package or `PIL` package. The `Pillow` package is recommended, as `PIL` is no longer actively maintained.
|
||||||
|
|
||||||
Signature and validation is the same as with `FileField`.
|
Signature and validation is the same as with `FileField`.
|
||||||
|
|
||||||
|
|
|
@ -966,7 +966,7 @@ class ImageField(FileField):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
from rest_framework.compat import Image
|
from rest_framework.compat import Image
|
||||||
assert Image is not None, 'PIL must be installed for ImageField support'
|
assert Image is not None, 'Either Pillow or PIL must be installed for ImageField support.'
|
||||||
|
|
||||||
# We need to get a file object for PIL. We might have a path or we might
|
# We need to get a file object for PIL. We might have a path or we might
|
||||||
# have to read the data into memory.
|
# have to read the data into memory.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user