Does canvas ImageData in JavaScript contain EXIF info?
Asked Answered
W

1

10

From the Docs

ImageData interface represents the underlying pixel data of an area of a canvas element

I would like to know does ImageData will have only pixel data or pixel data + meta data? Meta data means any EXIF data like orientation, resolution, file type or dpi.

Problem

Whenever I draw images with EXIF Orientation other than 1 to canvas and read it back as ImageData, the resulted ImageData is not properly aligning on Image tag when I am converting ImageData to DataURL.

Issue is observed both in mobile as well as desktop browsers all most all browsers.

Wilkison answered 1/12, 2015 at 18:34 Comment(0)
B
9

<canvas> does not preserve any JPEG metadata, as this metadata is specific to JPEG file itself. Canvas, by definition, is raw pixel data only.

Brest answered 1/12, 2015 at 19:22 Comment(3)
Does inkjet helps in manipulating EXIF data? i.e changing DPI or resolution values?Wilkison
By "play with canvas" I mean "do whatever canvas operations you want to do with your javascript"Brest
is there any method which can be used to save metadata along with image data before using canvas.toDataUrl().Charmine

© 2022 - 2024 — McMap. All rights reserved.