I am developing a webApp where user can upload pictures. I am having problems with some SAMSUNG phones. The problem is that when a picture is taken in landscape mode, it is saved horizontally and the exif(orientation) variable set to 0. If the picture is taken in portrait mode, the picture is still stored in landscape mode but the EXIF(orientation) variable is now set to 6 (corresponding to a rotation of 90 deg).
According to the following discussion, JS Client-Side Exif Orientation: Rotate and Mirror JPEG Images
if the orientation variable is set to 6, the following transformation has to be done
case 6: ctx.transform(0, 1, -1, 0, height, 0); break;
this rotates the image 90 deg, and is of course wrong, because the picture has to stay in portrait mode.
How can the problem be solved ?