Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

carlosl3g

macrumors newbie
Original poster
Oct 21, 2008
10
0
Hi, is it posible to do that?:

Code:
NSLog(@"SIZE OF IMAGE: %d ", sizeof(UIImageJPEGRepresentation((imageView.image), 0.5)));

because I got 4 as answer so I think it's a pointer.

How could I get an image size if I don't have the path yet?
I've seen:

Code:
- (NSDictionary *)attributesOfItemAtPath:(NSString *)patherror:(NSError **)error

but I need the size before the image is saved.


Thaks for your help.
 
There is a property that returns the size like:

805300712

but this is a CGSize wich is actually widht and heigh and I want to get the size in bytes.
 
It's OK I've found it:

Code:
NSData *imageData = [[NSData alloc] initWithData:UIImageJPEGRepresentation((imageView.image), 0.5)];
	int imageSize = imageData.length;
	NSLog(@"SIZE OF IMAGE: %i ", imageSize);
	if( imageSize > 0)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.