when i download a image use sdwebimage, and i print in the image downloader operation's - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {
UIImage *image = [UIImage sd_imageWithData:self.imageData];
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
image = [self scaledImageForKey:key image:image];
NSLog(@"didCompleteWithError:%@ data lenght:%ld png::%ld,jpg:%ld",self.request.URL,[self.imageData length],[UIImagePNGRepresentation(image) length],[UIImageJPEGRepresentation(image, 1) length]);
the logs turns that
data lenght:163480 png::202498,jpg:131774
and the raw data length is the exact file size as the image file in server , but when i create a image with these raw data , and use UIImagePNGRepresentation or UIImageJPEGRepresentation to get the UIImage's NSData length , it seems that both png and jpg presentation (no compression) of UIImage will be more larger the the raw data. what makes this happen?