rotate image each time for 90 degree.
npm install @joyfulljs/rotate-imagenpm install @joyfulljs/rotate-image
jsx
import imageRotate from '@joyfulljs/rotate-image';
// { ... omitted .... }
;
var dataUrl = roteteImage(imgRef.current);
imgRef.current.src = dataUrl;
`
api
roateImage(img: HTMLImageElement, options: { quality?: number, mineType?: string }): string
- options.quality default to 1
- options.mineType default to image/jpeg
most of times you do not need to provide options`, in case you need to save rotated image back to server;