Opened 11 years ago

Closed 11 years ago

#20193 closed Uncategorized (duplicate)

About replacing PIL with Wand

Reported by: kamaldeep.tumkur@… Owned by: nobody
Component: Uncategorized Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



I've been using Django 1.3 on a small project and have a custom template tag to return image dimensions. I have imported the django.core.files.images module. The PIL library which is in use there seems to be a little restrictive in terms of the kinds of files it can accept. I used a sample TIF file I had and called 'get_image_dimensions' with this file path. PIL was not able to identify the TIF file. A simple JPG file worked fine.

Instead, I used Wand on the same TIF file and was able to get dimensions accurately. Here's an example of it's usage from the page:

from wand.image import Image

with Image(filename='mona-lisa.png') as img:

print img.size

I have not tried any further to validate the robustness of this package, but general reading seemed to suggest that Wand is a newer version layered upon ImageMagick and may even have a PIL compatibility layer in the future.

Just wanted to bring this up for consideration. Thanks for your time.

Change History (1)

comment:1 by Matt, 11 years ago

Resolution: duplicate
Status: newclosed

Moving away from PIL was brought up a few weeks ago on the django-developers mailing list. The current plan appears to be to move to Pillow.

See the thread!searchin/django-developers/pil/django-developers/lEieWsPZNH0/7dyZgb7MUbUJ

And the resulting ticket:

If you have an opinion on what package to move to, I'd recommend commenting in that ticket.


Note: See TracTickets for help on using tickets.
Back to Top