Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6741233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:42:01+00:00 2026-05-26T11:42:01+00:00

I need an app for crop an image in the client side, I mean,

  • 0

I need an app for crop an image in the client side, I mean, using a cropping tool like Jcrop jquery plugin.

I found this tools:

  • django-image-cropper
  • django-image-cropping
  • django-imagehandler
  • django-avatar-crop

But the last two depends of admin and the two first seem very coupled to ther own ImageFields and models, any good solution?

We are working over a big application with many features and is very difficult change the logic writed

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:42:02+00:00Added an answer on May 26, 2026 at 11:42 am

    I think this is something that you will probably be best off writing yourself as it depends on how your data and models are layed out, whether (and where) you want to save the crops, if you want to keep the originals etc. Even if you have a big app, you will probably spend more time trying to bend other code to do what you need in your situation.

    (This code is very rough – I’m just laying out the steps really)

    If you have a model with an imagefield, you could add a second image field to hold the cropped image:

    class MyModel(models.Model):
        image = models.ImageField(...)
        image_crop = models.ImageField(...)
    

    and a form with an extra field to hold the jcrop coordinates that will be populated in the form on the client side (the field will be hidden). In what form you save the coordinates into the field is up to you, but it might be an idea to use a json dictionary (json.js on the client side and simplejson on the server side), something like:

    { 'x1' : '145', 'y1' : '200'  ... }
    

    the form:

    class MyModelForm(form.ModelForm):
        """ Hide a field to hold the coordinates chosen by the user """
        crop_coords = forms.CharField(attrs={'style':'display:none'})        
    
        class Meta:
             model = MyModel
    

    a view that processes all this:

    def some_view(request):
        form = request.POST
        if form.is_valid():
            crop_coords = form.cleaned_data['crop_coords']
            # decode the coords using simpleson (or however you passed them)
            ...
            # create a cropped image 
            original_image = form.cleaned_data['image']
            cropped_image = cropper(original_image.path, crop_coords)
            ...
            # save it back to the db - http://stackoverflow.com/questions/1308386/programmatically-saving-image-to-django-imagefield
            ...
    

    and a function to create the cropped image using PIL:

    # Look here: http://djangosnippets.org/snippets/224/
    def cropper(original_image_path, crop_coords):
        """ Open original, create and return a new cropped image
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a Rails 3 app using Paperclip to crop images. I have
I am building a scalable Server Side App in Java but I need to
I need to resize/crop images in different resolutions for Android App. I know, that
In my app i need to select a image from photos library and then
I need an app that sends an UDP packet to some network server and
I need to store app specific configuration in rails. But it has to be:
In my app i need to save changed values (old and new) when model
I need a simple app to edit database tables. Are there any code generators
In my app users need to be able to enter numeric values with decimal
In my app I need to draw a widget contents onto Bitmap. The code(pseudo)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.