Skip to content

Instantly share code, notes, and snippets.

@movii
Created April 30, 2017 08:31
Show Gist options
  • Save movii/ee6d5ec6453b41437cc328349b9f89cb to your computer and use it in GitHub Desktop.
Save movii/ee6d5ec6453b41437cc328349b9f89cb to your computer and use it in GitHub Desktop.
switch (EXIF.orientation) {
case 2: ctx.transform(-1, 0, 0, 1, width, 0); break;
case 3: ctx.transform(-1, 0, 0, -1, width, height ); break;
case 4: ctx.transform(1, 0, 0, -1, 0, height ); break;
case 5: ctx.transform(0, 1, 1, 0, 0, 0); break;
case 6: ctx.transform(0, 1, -1, 0, height , 0); break;
case 7: ctx.transform(0, -1, -1, 0, height , width); break;
case 8: ctx.transform(0, -1, 1, 0, 0, width); break;
default: ctx.transform(1, 0, 0, 1, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment