Daguerre allows you to influence how images are cropped with Areas <.Area>
.
Daguerre provides a widget which can be used with any ImageField
to edit Areas <.Area>
for that image file. Add this formfield override to your ModelAdmin to enable the widget.
from daguerre.widgets import AreaWidget
class YourModelAdmin(admin.ModelAdmin):
formfield_overrides = {
models.ImageField: {'widget': AreaWidget},
}
...
AreaWidget
allows you to define areas of an image with click-and-drag. (Screenshot includes Grappelli.)
After you define Areas <.Area>
for an image in the admin, adjustments that remove parts of the image (such as crop) will protect those parts of the image during processing. See the difference in this adjustment.
<img src="{% adjust my_model.image "fill" width=600 height=200 %}" />
Result without 'face' Area defined |
---|
Result with 'face' Area defined |
---|
You can also use the built-in "namedcrop" adjustment force a specific crop.
<img src="{% adjust my_model.image "namedcrop" name="face" %}" />