Auto rotate image (#737)
This commit is contained in:
parent
8d166ca642
commit
da0e9204c4
|
@ -39,7 +39,7 @@ if (BROWSER_ENV) {
|
|||
const metadata = await img.metadata();
|
||||
const rawChannels = metadata.channels;
|
||||
|
||||
let { data, info } = await img.raw().toBuffer({ resolveWithObject: true });
|
||||
let { data, info } = await img.rotate().raw().toBuffer({ resolveWithObject: true });
|
||||
|
||||
const newImage = new RawImage(new Uint8ClampedArray(data), info.width, info.height, info.channels);
|
||||
if (rawChannels !== undefined && rawChannels !== info.channels) {
|
||||
|
|
Loading…
Reference in New Issue