I read in a file from an HTML file input. For iOS I can take a picture from the camera. The problem is that if you take the picture with the camera the content will include EXIF data(at least if I read the file content with the FileReader API).
I can't use canvas cropping if the image includes EXIF data. Because the image get destroyed every time I call
.toDataURL()
. My guess is it doesn't recognize EXIF data and don't know how to crop a image with EXIF data.The file content is being base64 encoded by
FileReader.readAsDataURL()
. And I insert it into img.src.The cropping is done by drawing a new image with
ctx.drawImage(...)
based in the old image and I finally got the new image data withc.toDataURL()
.
So my question how do I remove EXIF data using javascript?