I have some file with size (1000x1000 for example).
I want to load it and make it smaller
UIImage *newImage = [UIImage imageWithCGImage:[UIImage imageWithContentsOfFile:filename].CGImage scale:(1.0f / scale) orientation:UIImageOrientationUp];
NSLog(newImage size: %f, %f", newImage.size.width, newImage.size.height);
// shows correct scaled size -> 50, 50
Then i want to save this scaled image
NSData* imageData = UIImageJPEGRepresentation(newImage, 1.0);
[imageData writeToFile:otherFileName atomically:NO];
I was confused to see that new image was saved with first start size(1000x1000).
How can it be possible and what to do with this?