Merge pull request #3939 from popcornmix/reenc_orient