Here's the code I use:
NSImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:@"test.jpg"];
NSData *originalData = [image TIFFRepresentationUsingCompression:NSTIFFCompressionJPEG factor:1.];
The originalData.length
gives me 1802224 bytes (1.7MB). While the image size on the disk is 457KB. Why does TIFFRepresentation
get larger and which representation I should use in order to get original image (i want to transfer image over the network)?