sdwebimage
- (void)webDataManager:(SDWebDataManager *)dataManager didFinishWithData:(NSData *)aData isCache:(BOOL)isCache { UIImage *img=[UIImage imageWithData:aData]; if(aData.length == 79107 || aData.length == 78588 || aData.length == 78762 || aData.length == 7854) { // NSLog(@"------------default_big_pic------------"); self.image = PNGImage(@"default_big_pic"); return; } NSLog(@"img size = %@",NSStringFromCGSize(img.size)); if(img.size.height == img.size.width) { //正方形图片等比例缩放 self.contentMode = UIViewContentModeScaleAspectFit; } else { //等比例放大 CGSize size = self.frame.size; UIImageView *viewimg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)]; viewimg.image = img; self.image = viewimg.image; return; } self.image = img; }