use rotatedata to rotate the image