SDWebImage (2.7.3 フレームワーク) を使用していますが、破損した画像を受信しました。問題を正確に理解できません。コードの場合(メモリ...)
(注:SDWebImage
フレームワークの代わりにプロジェクトを使用して同じエラーが発生します。「自動解放」およびその他の種類のメモリ管理を実装しています。この問題はデバイス(iPad)で発生しますが、シミュレーターでは発生しません)
__block CALayer *layerCover = [[CALayer alloc] init];
layerCover.frame = CGRectMake(3, 3, COVER_WIDTH_IPAD_SMALL, COVER_HEIGHT_IPAD_SMALL);
[btn.layer addSublayer:layerCover];
[_scroll addSubview:btn];
[btn release];
//request or load Vods Images
[[SDWebImageManager sharedManager] downloadWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@M", vod.cover]]
delegate:self options:SDWebImageProgressiveDownload success:^(UIImage *image, BOOL cached) {
if (image) {
layerCover.contents = (id)image.CGImage;
}
[layerCover release];
} failure:^(NSError *error) {
[layerCover release];
}];
//別の種類
UIImage * imageTv = [UIImage imageNamed:@"bgDefaultTvImage.png"];
UIImageView * bgTvImage = [[UIImageView alloc] initWithFrame:CGRectMake(startX, 20, imageTv.size.width, imageTv.size.height)];
[bgTvImage setImage:imageTv];
CGFloat sizeWithIcon = imageTv.size.width;
CGFloat sizeHeightIcon = imageTv.size.height;
__block UIImageView * bgImageicon = [[UIImageView alloc] initWithFrame:CGRectMake((bgTvImage.frame.size.width-sizeWithIcon)/2,
(bgTvImage.frame.size.height-sizeHeightIcon)/2,
sizeWithIcon,
sizeHeightIcon)];
bgImageicon.contentMode = UIViewContentModeScaleAspectFit;
[bgTvImage addSubview:bgImageicon];
[tvTopView addSubview:bgTvImage];
/*
* Request ProgramImage
*/
[[SDWebImageManager sharedManager] downloadWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@&width=300",program.ProgramImage.imageURL]]
delegate:self options:SDWebImageProgressiveDownload success:^(UIImage *image, BOOL cached) {
if (image) {
iconCanal = image;
[bgImageicon setImage:iconCanal];
}
[bgImageicon release];
}failure:^(NSError *error) {
[bgImageicon release];
}];
Xcode ログ:
<Error>: ImageIO: JPEG Corrupt JPEG data: bad Huffman code
<Error>: ImageIO: JPEG Corrupt JPEG data: premature end of data segment