fengyuanchen / cropperjs

JavaScript image cropper.
https://fengyuanchen.github.io/cropperjs/
MIT License
13.15k stars 2.42k forks source link

Probleme with image base64 and tranform #1153

Closed nbao closed 3 months ago

nbao commented 8 months ago

Describe the bug user cdn cropperjs version 1.6.1 image is data:image base64 cavans with transformY is too much it must set value 0 To Reproduce Steps to reproduce the behavior: use simple script window.addEventListener("DOMContentLoaded", () => { const capturedImage = document.getElementById("captured-image"); let cropper = new Cropper(capturedImage, { ready: () => { this["croppable"] = true; }, }); });

Debug with event event.detail.x: 119.50000000000004 event.detail.y: 91.89999999999996 event.detail.width: 2150.9999999999995 event.detail.height: 1654.2 event.detail.rotate: 0 event.detail.scaleX: 1 event.detail.scaleY: 1

Screenshots If applicable, add screenshots to help explain your problem. Capture d'écran 2024-03-24 114021

Additional context if transformY = 0 it's perfect

fengyuanchen commented 7 months ago

Please follow this example step by step: https://github.com/fengyuanchen/cropperjs?tab=readme-ov-file#example