Variable seems to not get set on mobile devices : <p>I'm reading an image file and rescaling it to send it to a server. In order to properly rescale it I need to change the orientation, since some pictures are taken with a mobile device camera. In order to do this rotation I did the following using the <a href="https://github.com/exif-js/exif-js" rel="noreferrer">exif.js</a> library:</p>

<pre><code>EXIF.getData(img, function() {    
    alert(this.exifdata.Orientation);
    orientation = this.exifdata.Orientation;
    alert(orientation);
}
</code></pre>

<p>If <code>this.exif.data.Orientation</code> was, for example 6, the following output would be desierd: "6", "6".</p>

<p>This works when a file is uploaded via my computer. However, when uploaded from a mobile device camera, the output is "6" and then "0", no matter what value <code>orientation</code> had before.</p>

<p>Why does this happen?</p>

<p><strong>Note:</strong> I'm only running on one thread. So the variable could not have been set externally during execution of these lines.</p>
