{"action":"created","issue":{"url":"https://api.github.com/repos/itouch2/PhotoTweaks/issues/11","labels_url":"https://api.github.com/repos/itouch2/PhotoTweaks/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/itouch2/PhotoTweaks/issues/11/comments","events_url":"https://api.github.com/repos/itouch2/PhotoTweaks/issues/11/events","html_url":"https://github.com/itouch2/PhotoTweaks/issues/11","id":66737359,"number":11,"title":"Hello when I try saving metadata to an image the UIImageOrientation will be flipped?","user":{"login":"jrr363","id":5199806,"avatar_url":"https://avatars.githubusercontent.com/u/5199806?v=3","gravatar_id":"","url":"https://api.github.com/users/jrr363","html_url":"https://github.com/jrr363","followers_url":"https://api.github.com/users/jrr363/followers","following_url":"https://api.github.com/users/jrr363/following{/other_user}","gists_url":"https://api.github.com/users/jrr363/gists{/gist_id}","starred_url":"https://api.github.com/users/jrr363/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrr363/subscriptions","organizations_url":"https://api.github.com/users/jrr363/orgs","repos_url":"https://api.github.com/users/jrr363/repos","events_url":"https://api.github.com/users/jrr363/events{/privacy}","received_events_url":"https://api.github.com/users/jrr363/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-07T00:17:42Z","updated_at":"2015-04-08T18:56:37Z","closed_at":null,"body":"you have any ideas on why? Great project by the way love the simplicity!"},"comment":{"url":"https://api.github.com/repos/itouch2/PhotoTweaks/issues/comments/91003695","html_url":"https://github.com/itouch2/PhotoTweaks/issues/11#issuecomment-91003695","issue_url":"https://api.github.com/repos/itouch2/PhotoTweaks/issues/11","id":91003695,"user":{"login":"jrr363","id":5199806,"avatar_url":"https://avatars.githubusercontent.com/u/5199806?v=3","gravatar_id":"","url":"https://api.github.com/users/jrr363","html_url":"https://github.com/jrr363","followers_url":"https://api.github.com/users/jrr363/followers","following_url":"https://api.github.com/users/jrr363/following{/other_user}","gists_url":"https://api.github.com/users/jrr363/gists{/gist_id}","starred_url":"https://api.github.com/users/jrr363/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrr363/subscriptions","organizations_url":"https://api.github.com/users/jrr363/orgs","repos_url":"https://api.github.com/users/jrr363/repos","events_url":"https://api.github.com/users/jrr363/events{/privacy}","received_events_url":"https://api.github.com/users/jrr363/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T18:56:37Z","updated_at":"2015-04-08T18:56:37Z","body":"Yup yup you were definitely correct. Thank you! Below: I changed your 'saveBtnTapped' method a little to give the user the option to save with or without metadata.\r\n\r\n- (void)saveBtnTapped:(BOOL)metadata\r\n{\r\n    CGAffineTransform transform = CGAffineTransformIdentity;\r\n    \r\n    // translate\r\n    CGPoint translation = [self.photoView photoTranslation];\r\n    transform = CGAffineTransformTranslate(transform, translation.x, translation.y);\r\n    \r\n    // rotate\r\n    transform = CGAffineTransformRotate(transform, self.photoView.angle);\r\n    \r\n    // scale\r\n    CGAffineTransform t = self.photoView.photoContentView.transform;\r\n    CGFloat xScale =  sqrt(t.a * t.a + t.c * t.c);\r\n    CGFloat yScale = sqrt(t.b * t.b + t.d * t.d);\r\n    transform = CGAffineTransformScale(transform, xScale, yScale);\r\n    \r\n    CGImageRef imageRef = [self newTransformedImage:transform\r\n                                        sourceImage:self.image.CGImage\r\n                                         sourceSize:self.image.size\r\n                                  sourceOrientation:self.image.imageOrientation\r\n                                        outputWidth:self.image.size.width\r\n                                           cropSize:self.photoView.cropView.frame.size\r\n                                      imageViewSize:self.photoView.photoContentView.bounds.size];\r\n    \r\n    \r\n    NSData *imageData;  //Data from some NSDictionary\r\n    if (metadata == YES) {\r\n\t\t//Do something with data\r\n    }\r\n\r\n    \r\n    //if ([self.delegate respondsToSelector:@selector(finishWithCroppedImage:)]) {\r\n    //    [self.delegate finishWithCroppedImage:image];\r\n    //}\r\n    if (self.autoSaveToLibray) {\r\n        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];\r\n        if (metadata == NO) {\r\n            NSLog(@\"Should save without metadata\");\r\n            ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];\r\n            [library writeImageToSavedPhotosAlbum:imageRef metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {\r\n               if (!error) { }\r\n            }];\r\n            \r\n        } else {\r\n            \r\n            NSLog(@\"Should save with metadata\");\r\n            [library writeImageDataToSavedPhotosAlbum:imageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {\r\n                if (!error) {\r\n                }\r\n            }];\r\n        }\r\n    }\r\n\r\n    [self dismissViewControllerAnimated:YES completion:nil];"}}