Fixed Bug #64962 	imagerotate produce corrupted image

See https://bitbucket.org/libgd/gd-libgd/issue/67/problem-with-gdrotate

This computation need to be done in signed range.