melinath / django-daguerre

On-the-fly image manipulation for Django.
http://django-daguerre.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
85 stars 15 forks source link

Better PIL imports #12

Closed melinath closed 12 years ago

melinath commented 12 years ago

PIL can be installed in two different ways, and we haven't been accounting for that.

harrislapiroff commented 12 years ago

Is it possible there would be some advantage to centralizing this logic,—i.e., maybe importing Image into utils.py and then always importing from there? It seems DRYer, but this is also a very small bit of code.

This, actually, raises the question of centralizing all the image processing stuff altogether... sorl, for instance, provides multiple thumbnailing engines. On the other hand, maybe sticking with and requiring PIL would give us more flexibility in what sorts of processing we're capable of (this is beyond the scope my my knowledge, so I look to your comment).

I see no problems merging this, otherwise, though.

melinath commented 12 years ago

I actually considered adding a PIL module (or PIL_compat, or something) that would handle this, but I wasn't sure whether it was enough to warrant it. (it might be.)

As for multiple engines - I have no idea what sorl's convert_engine backend is doing, and I don't have a clear idea of the advantages of pymagick over PIL. It would be a great feature, in abstract, and we should maybe open a ticket for it, but I don't think it's something we need to do this instant.

harrislapiroff commented 12 years ago

OK. In that case I am just going to merge this in that case. (Also, according to the documentation, convert_engine seems to be an ImageMagick and/or GraphicsMagick backend?)