'Allow the user to crop image manually django
I'm stuck with a problem for a long time on the website I'm working on with django.
In my django model, I've added an Image field for the profile pic, using django_resized
So now when an user is choosing a pic, I'm cropping and resizing it as a square of 315*315. But I can only choose where the pic is cropped (here in the middle). In some cases, the people's faces are not exactly in the center of the pic and that's a problem.
I would like to allow the user to choose manually where to crop the image (with a square to move on the pic), just as all the social medias are doing when you upload a profile pic.
Here's my code, thank you very much in advance.
from django.db import models
from django_resized import ResizedImageField
class Account(models.Model):
profile_pic = ResizedImageField(size=[315, 315], crop=['middle', 'center'], quality=99, default="default_profile_pic.png", null=True, blank=True)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
