UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:portrait.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(20, 20)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = portrait.bounds;
maskLayer.path = maskPath.CGPath;
portrait.layer.mask = maskLayer;
[maskLayer release];