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

821
Views
How to fit image to specific cropped area to only move with Cropper JS

I'm using cropper JS to resize images to a specific crop area. But when I upload a image that is lower than crop area, the image don't fit the area. I want to fit the image (height or widht) and only choose the crop area moving the image, like the facebook upload cover photo functionality.

Here is my actual code:

        const cropper = new Cropper(image, {
            viewMode: 0, 
            zoomable: false,
            movable: true,
            cropBoxResizable: false,
            cropBoxMovable: true,
            dragMode: 'move',
            data: {
                width: 1370,
                height: 385,
            },
        })

And I want this result like facebook

enter image description here

What I want to achieve is zoom the image till fill the cropped size

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!