bug fix: rotation in C code

the bug: when importing a picture with imbeded rotation, the rotate
function in native code was not working correctly