0

OK. Been working on submitting a form where on of the fields is an imagefield and save as an object in the database. Can't get anything to work... So Im back where im started and my simple question is:

Do i need to install Pillow or PIL to make this? If so which would you recommend?

Thanks!

UPDATE: NO. Using PIL/Pillow is only required if you want to do image processing.

user3199840
  • 525
  • 2
  • 13
  • 35

1 Answers1

3

Yes, as the ImageField documentation states:

Requires the Pillow Library.

You can use either PIL or Pillow, but the latter contains many fixes and improvements over the original package, and only Pillow works on Python 3. I'd install Pillow.

The dependency is used to determine the image dimensions.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Thank you. Yes i've seen that in the docs. The reason why I ask is that i can upload images in my admin and i've seen some tutorials with imagefields where they didn't mention that.. – user3199840 Feb 02 '14 at 03:15
  • It would be useful sometimes to detach ImageField from PIL/Pillow. I'm developing a Django webapp running on Jython, I'd need to use an ImageField but unfortunately Jython doesn't support one or the other. – Paolo Sep 24 '14 at 19:52
  • 1
    @Guandalino: you'd have to provide a Jython equivalent for the [`ImageFile` class](https://github.com/django/django/blob/master/django/core/files/images.py), plus wrappers up to the `ImageField` object. – Martijn Pieters Sep 24 '14 at 20:36