Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

302
Vistas
JCrop: How to upload Image from client side in a canvas?

PS: Not a duplicate as it has multi cropping feature.

I am make a Image crop app with multiple sections cropping areas, after lot of try and research I found Jcrop useful. Now I am trying to make interface where client can upload their image by itself and then crop easily.

  • In below HTML there is static image as of now and upload button too where user can upload and replace static image in a canvas.

HTML code:

  <div style="padding:0 5%;">
<h1 style="font-family:Helvetica,sans-serif;">
  Jcrop Example <span style="color:lightgray;">- draw some crops!</span>
</h1>

<img id="target" src="https://d3o1694hluedf9.cloudfront.net/market-750.jpg">


 <div class="file btn btn-lg btn-primary">
  Upload
   <input type="file" name="file" />
 </div>
</div>

JavaScript:

  var jcp;
Jcrop.load('target').then(img => {
  jcp = Jcrop.attach(img, { multi: true });
  const rect = Jcrop.Rect.sizeOf(jcp.el);
  jcp.newWidget(rect.scale(.7, .5).center(rect.w, rect.h));
  jcp.focus();
});



function setImage(tag) {
  document.getElementById('target').src =
    'https://d3o1694hluedf9.cloudfront.net/' + tag;
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda