Skip to content

kimus/image-poi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

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.

image example

Examples

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 %}

About

Add Point Of Interest Field for supporting sorl-thumbnail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages