Questions tagged [cropperjs]

Javascript MVVM Framework. If you use this tag you might also include JavaScript and mvvm

###References

235 questions
10
votes
0 answers

CropperJS cropper Destroy Issue fengyuanchen/cropperjs

I am trying to destroy cropper when model close here is my code i am using https://github.com/fengyuanchen/cropperjs var image = document.getElementById('image_cropper'); var cropper = new Cropper(image); cropper.destroy(); cropper = null; var…
M Arfan
  • 4,384
  • 4
  • 29
  • 46
7
votes
2 answers

How to get cropped image from cropper js?

I am trying to get cropped image result from cropperjs but I dont know how to get it. I tried to search online but couldn't find a solution. My code is as given below. $(function () { $image=null; var img = document.createElement("IMG"); …
6
votes
1 answer

Cropper.js crop programmatically

I am using cropper.js (https://github.com/fengyuanchen/cropperjs) to manipulate images, but I could not find a way to crop my image programmatically. What I am trying to do is create a cropped preview immediately after initialising the cropper. var…
o15a3d4l11s2
  • 3,969
  • 3
  • 29
  • 40
6
votes
1 answer

Using cropper with ng-file-upload

I'm using ng-file-upload to preview and upload an image. Before I upload the image I'd like to have the user crop the image. I tried using ng-img-crop, but that didn't have the features I wanted (aspect ratio customization), but cropper did…
Brandon
  • 2,886
  • 3
  • 29
  • 44
5
votes
0 answers

Cropper.js - Export image in certain width and height

I´m using the jquery version of the cropper.js. The script works fine so far. But one thing I can´t get done. I want to have my cropped pictures in an aspect ratio of 16 / 9 with the width of 280px and the height of 158px. Is that possible with…
Peterline
  • 75
  • 5
4
votes
1 answer

Add Brightness and Contrast to Cropper JS without Caman JS?

Because CamanJS is no longer maintained, does anyone know of a newer lightweight solution to add brightness and contrast adjustment to Cropper JS like this CodePen? HTML:
Nathan
  • 1,483
  • 3
  • 18
  • 41
4
votes
4 answers

CropperJS getCroppedCanvas() returns null on second initialization

The method is called in the ready event. On the first call it works. When the modal is closed, I am destroying the cropper - cropper.destroy() . After opening the modal second time, the cropper is initialized again but this time…
Toma Tomov
  • 1,476
  • 19
  • 55
4
votes
0 answers

Show image only inside cropping-area (cropper-js)

I'm working on an image cropping tool with use of cropper-js (made by fengyuanchen). It's an awesome tool and everything works perfect, except for one thing and I'm not sure if I miss something in the settings. The user should be able to move the…
Mazeland
  • 41
  • 5
4
votes
2 answers

how to give cropper.js a fixed height and width to crop accordingly

I am using cropper.js v0.8.0 I using the below jQuery code to crop the image. function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { …
Akshay Shrivastav
  • 1,115
  • 4
  • 17
  • 43
4
votes
1 answer

Cropper.js how to get cropper instance from handled event

I'm trying to realize auto resizing or cropbox when box size less than minimum allowed image size, for now I made this: var cropper = document.getElementById('image_cropper').cropper; if (!cropper instanceof Cropper) { …
Oleg Shakhov
  • 426
  • 6
  • 27
4
votes
3 answers

Cropper JS : Positioning/size issue inside Bootstrap modal

This is the output screen, where image is not properly positioned, sized inside bootstrap modal. I am trying to use the 'cropper.js' plugin in 'avatar' update section of my project.I added the related CSS and JS files also using jquery and the…
Ajesh VC
  • 635
  • 5
  • 13
3
votes
2 answers

JavaScript: Multiple cropping selection in one image?

PS: Is it not a research kind of question! I have been trying to do this from very long time. I am trying to make web based an image editor where user can select multiple cropping area and after selection save/download all the image area. like…
kate moss
  • 416
  • 1
  • 5
  • 18
3
votes
2 answers

Angular 9: How to convert HEIF file format to a known web format when uploading images

I am mantaining a webapp (PWA) written in Angular 9, where users upload images and crop, rotate etc. in cropperjs. On iOS a new image format (HEIF) is becoming the standard and these users are complaining that they are not able to upload their…
Jette
  • 2,459
  • 28
  • 37
3
votes
0 answers

Uncaught TypeError: Cannot read property 'width' of undefined at Cropper.zoomTo

I am using react-cropper version 2.0.0. I don't really understand the problem. It occurs in cropperjs zoomTo method. I have initialized the cropper instance on bootstrap modal. I see the cropper is initialized correctly and also show canvasData…
DeWy Sady
  • 320
  • 2
  • 16
3
votes
2 answers

How to apply cropping to image with cropper.js?

I'm trying to realize, how to use cropper.js, and so far it looks pretty good, but... when I trying to crop the image, how can I put the result back to my form? My input has id 'profile_avatar'. So I try to put there updated image, and…
Ruslan Valeev
  • 1,529
  • 13
  • 24
1
2 3
15 16