Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

93
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda