My application download JPEG image from server as NSData, check for other params (in json response) and if that image should be rotated according to some flag, I need to rotate image and store it to file for later use.
I would like to rotate image's data directly without compressing already JPEG image again before saving (download, decompress, rotate, compress using UIImageJPEGRepresentation or UIImagePNGRepresentation). Is there a way how to accomplish rotation of JPEG image without recompression on iOS?