About replacing PIL with Wand
|Reported by:||kamaldeep.tumkur@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||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:
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.