canvas
canvas copied to clipboard
EXIF orientation is ignored?
When I draw an image with orientation set in the EXIF, it comes out sideways, eg ignores the EXIF - using canvas in the browser works fine in both Chrome and Firefox
In the meantime, I will parse the EXIF on image uploads myself and correct it that way, but just thought I'd let you know!
const buffer = await readFile( 'IMG_6716.JPG' )
const image = new Image()
image.src = buffer
const canvas = createCanvas( image.naturalWidth, image.naturalHeight )
const context = canvas.getContext( '2d' )
context.drawImage( image, 0, 0 )
const out = canvas.toBuffer('image/png')
await writeFile( 'IMG_6716.PNG', out )
Here is the image: