This project makes it possible to choose how an image will be cropped by sorl-thumbnail. Choosing Noop, Top, Center, etc and also a widget to choose the Point Of Interest of an image.
Thanks to francescortiz/image where this is based from.
Sample model:
from imagepoi.fields import ImageCenterField
class Test(models.Model):
image = ImageField(upload_to="test")
image_center = ImageCenterField(image_field=image)
Sample urls.py:
from django.conf.urls import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^admin/imagepoi/', include('imagepoi.urls')),
)
Sample template:
{% thumbnail item.image "100x86" crop=item.image_center.value as im %}
<img src="{{ im.url }}" alt="{{ item.description }}" />
{% endthumbnail %}