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

339
Views
smartcrop.js - How to configure smartcrop.js

I'm trying to crop an image using smartcrop.js whose original dimensions are 2042px by 1443px. The configuration below crops it to 23px by 17px. The image is loaded from an AWS Bucket.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/smartcrop/2.0.5/smartcrop.js">
</script>
<script type="text/javascript">
    window.addEventListener('DOMContentLoaded', function() {
        const image = document.getElementsByTagName("img").item(0);
        SmartCrop.crop(image, {
            width: 1025,
            height: 750,
            minScale: 1.0
        }).then(function(result) {
            image.style.width = result.topCrop.width + "px";
            image.style.height = result.topCrop.height + "px";
        });
    }, false);
</script>

What is the correct configuration?

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!