django-filer icon indicating copy to clipboard operation
django-filer copied to clipboard

subject location on alias in settings

Open mirzadelic opened this issue 10 years ago • 4 comments

Hi, i have aliases for thumbnail, and now i need to use subject location with them, how can i do that?

THUMBNAIL_ALIASES = {
    '': {
        'cover': {'size': (966, 330), 'replace_alpha': '#fff', 'autocrop': True, 'crop': True, 'upscale': True},
        'category': {'size': (406, 200), 'replace_alpha': '#fff', 'autocrop': True, 'crop': True, 'upscale': True},
        'article': {'size': (230, 120), 'replace_alpha': '#fff', 'autocrop': True, 'crop': True, 'upscale': True},
    }
}

mirzadelic avatar Jul 18 '13 17:07 mirzadelic

I'm not sure how THUMBNAIL_ALIASES works. Hopefully it allows passing in extra parameters with the template tag. Then you can do it as described in the docs: http://django-filer.readthedocs.org/en/0.9.4/installation.html#subject-location-aware-cropping

e.g {% thumbnail obj.img 200x300 crop upscale subject_location=obj.img.subject_location %} or {% thumbnail obj.img 200x300 crop upscale subject_location=50,25 %}

stefanfoulis avatar Jul 22 '13 08:07 stefanfoulis

Sorry for digging this one out. Is there a specific reason why scale_and_crop_with_subject_location doesn't automatically use the subject location set in the filer backend? That would make it possible to use the thumbnail_url template filter (http://easy-thumbnails.readthedocs.org/en/2.1/usage/#thumbnail-url-filter) together with subject location aware cropping.

febsn avatar Oct 21 '15 07:10 febsn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 28 '22 23:07 stale[bot]

still relevant.

febsn avatar Aug 16 '22 15:08 febsn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 14 '22 19:11 stale[bot]

Still relevant, needs a little design decision (Should scale_and_crop_with_subject_location use the default subject location saved in the database?)

febsn avatar Nov 23 '22 10:11 febsn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 21 '23 14:02 stale[bot]

This will now be closed due to inactivity, but feel free to reopen it.

stale[bot] avatar Mar 21 '23 22:03 stale[bot]