Iphone SDWebImage损坏的图像
我正在使用(2.7.3框架)并且收到损坏的图像,我无法确切理解问题所在。如果是代码(内存…) (注: 我使用Iphone SDWebImage损坏的图像,iphone,objective-c,ios,ipad,sdwebimage,Iphone,Objective C,Ios,Ipad,Sdwebimage,我正在使用(2.7.3框架)并且收到损坏的图像,我无法确切理解问题所在。如果是代码(内存…) (注: 我使用SDWebImage项目而不是框架得到了相同的错误。 我正在实现“自动释放”和其他类型的内存管理。 此问题出现在设备(iPad)上,但不在模拟器中) //另一种 UIImage * imageTv = [UIImage imageNamed:@"bgDefaultTvImage.png"]; UIImageView * bgTvImage = [[UIImageView alloc] i
SDWebImage
项目而不是框架得到了相同的错误。
我正在实现“自动释放”和其他类型的内存管理。
此问题出现在设备(iPad)上,但不在模拟器中)
//另一种
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
:图像IO:JPEG损坏的JPEG数据:错误的哈夫曼代码
:ImageIO:JPEG损坏的JPEG数据:数据段过早结束
这似乎是SDWebImageProgressiveDownload
标志的问题。尝试禁用它,例如:
[[SDWebImageManager sharedManager] downloadWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@&width=300",program.ProgramImage.imageURL]]
delegate:self options:0 success:^(UIImage *image, BOOL cached) {
if (image) {
iconCanal = image;
[bgImageicon setImage:iconCanal];
}
[bgImageicon release];
}failure:^(NSError *error) {
[bgImageicon release];
}];
我刚刚看到“路径”应用程序有同样的问题…你找到解决方案了吗?没有,但有时情况会发生变化,但是相等的…:(
[[SDWebImageManager sharedManager] downloadWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@&width=300",program.ProgramImage.imageURL]]
delegate:self options:0 success:^(UIImage *image, BOOL cached) {
if (image) {
iconCanal = image;
[bgImageicon setImage:iconCanal];
}
[bgImageicon release];
}failure:^(NSError *error) {
[bgImageicon release];
}];