Get the iOS album picture file size,
A lot of people, think of is to take the location of the file picture, and then through the NSData to get the image size, as everyone knows, so that the image size is not accurate.
The correct method should be implemented in the agent
Alassetslibrary* allibrary = [[alassetslibrary alloc] init];
[Allibrary assetforurl:[info objectforkey:Uiimagepickercontrollerreferenceurl] resultblock:^ ( alasset *asset)
{
alassetrepresentation *representation = [Asset defaultrepresentation];
if ([representation size] > 1024*1024*2) {
uialertview *alert = [[uialertview alloc]initwithtitle:nil message:@ " Picture exceeds 2M, please re-select " delegate:self cancelbuttontitle:@" OK " Otherbuttontitles:nil];
[Alert show];
[Alert release];
[self setretakebuttonenable:picker];
[Allibrary release];
return;
}
}
How iOS determines the size of album file pictures