LarpixClient/node_modules/super-image-cropper/esm/utils/index.js
olcxja 95aaaa69ea big updat:
- update dependencies
- add webp support and webp conversion for profile images
2026-07-02 22:40:46 +02:00

11 lines
502 B
JavaScript

export const renderImageData2Canvas = (imageData) => {
const tempCanvas = document.createElement('canvas');
const tempCtx = tempCanvas.getContext('2d');
const targetCanvas = document.createElement('canvas');
const targetCtx = targetCanvas.getContext('2d');
document.body.appendChild(targetCanvas);
tempCanvas.width = imageData.width;
tempCanvas.height = imageData.height;
tempCtx?.putImageData(imageData, 0, 0);
targetCtx?.drawImage(tempCanvas, 0, 0);
};