1

I am trying to get the orientation from an exif data like this: Extract exif orientation

    var img = new Image();
    img.src = "data:image/jpeg;base64," + imgData;
    img.onload = function () {
        var canvas = document.createElement("canvas");

        canvas.width = img.width;
        canvas.height = img.height;

        var bin = atob(img.src.split(',')[1]);
        var exif = EXIF.readFromBinaryFile(new BinaryFile(bin));
        alert(exif.Orientation);
        alert(EXIF.getTag(imgData, "Orientation"));

however all it alerts is undefined.... I am not sure why.

I have included exif.js and binaryajax.js in my html file so that is not the issue

Community
  • 1
  • 1
Prakash Chennupati
  • 3,066
  • 3
  • 27
  • 38

0 Answers0