Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

92
Views
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)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!