Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RGB color space model; kCGImageAlphaLast; #2

Open
CodeEagle opened this issue Oct 21, 2015 · 11 comments
Open

RGB color space model; kCGImageAlphaLast; #2

CodeEagle opened this issue Oct 21, 2015 · 11 comments

Comments

@CodeEagle
Copy link

CGBitmapContextCreate: unsupported parameter combination:
8 integer bits/component;
32 bits/pixel;
RGB color space model; kCGImageAlphaLast;
800 bytes/row.
Valid parameters for RGB color space model are:
16 bits per pixel, 5 bits per component, kCGImageAlphaNoneSkipFirst
32 bits per pixel, 8 bits per component, kCGImageAlphaNoneSkipFirst
32 bits per pixel, 8 bits per component, kCGImageAlphaNoneSkipLast
32 bits per pixel, 8 bits per component, kCGImageAlphaPremultipliedFirst
32 bits per pixel, 8 bits per component, kCGImageAlphaPremultipliedLast
64 bits per pixel, 16 bits per component, kCGImageAlphaPremultipliedLast
64 bits per pixel, 16 bits per component, kCGImageAlphaNoneSkipLast
128 bits per pixel, 32 bits per component, kCGImageAlphaNoneSkipLast |kCGBitmapFloatComponents
128 bits per pixel, 32 bits per component, kCGImageAlphaPremultipliedLast |kCGBitmapFloatComponents
See Quartz 2D Programming Guide (available online) for more information.
Oct 21 11:23:51 LuooFM[19236] : CGContextConcatCTM: invalid context 0x0. Backtrace:
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize13withTransformVSC17CGAffineTransform14drawTransposedSb20interpolat
<TFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+495>
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0_+60>
<TFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0_+697>
<TToFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0_+54>
<TFE4NaviCSo7UIImage25navi_avatarImageWithStylefS0_FOS_11AvatarStyleS0+733>
<TFFFFC4Navi9AvatarPodP33_8B0B5A6784EFC9FC4DDC7EE8BE0D2AF923completeRequestsWithURLFS0_FTCSo5NSURL5imageCSo7UIImage_T
<TTRXFo__dT__XFdCb__dT_+39>
<_dispatch_call_block_and_release+12>
<dispatch_client_callout+8>
<dispatch_root_queue_drain+1829>
<dispatch_worker_thread3+111>
<pthread_wqthread+1129>
Oct 21 11:23:51 LuooFM[19236] : CGContextSetInterpolationQuality: invalid context 0x0. Backtrace:
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize13withTransformVSC17CGAffineTransform14drawTransposedSb20interpolat
<TFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+495>
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+60>
<TFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0
+697>
<TToFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0
+54>
<TFE4NaviCSo7UIImage25navi_avatarImageWithStylefS0_FOS_11AvatarStyleS0+733>
<TFFFFC4Navi9AvatarPodP33_8B0B5A6784EFC9FC4DDC7EE8BE0D2AF923completeRequestsWithURLFS0_FTCSo5NSURL5imageCSo7UIImage_T
<TTRXFo__dT__XFdCb__dT
+39>
<_dispatch_call_block_and_release+12>
<dispatch_client_callout+8>
<dispatch_root_queue_drain+1829>
<dispatch_worker_thread3+111>
<pthread_wqthread+1129>
Oct 21 11:23:51 LuooFM[19236] : CGContextDrawImage: invalid context 0x0. Backtrace:
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize13withTransformVSC17CGAffineTransform14drawTransposedSb20interpolat
<TFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+495>
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+60>
<TFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0
+697>
<TToFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0
+54>
<TFE4NaviCSo7UIImage25navi_avatarImageWithStylefS0_FOS_11AvatarStyleS0+733>
<TFFFFC4Navi9AvatarPodP33_8B0B5A6784EFC9FC4DDC7EE8BE0D2AF923completeRequestsWithURLFS0_FTCSo5NSURL5imageCSo7UIImage_T
<TTRXFo__dT__XFdCb__dT
+39>
<_dispatch_call_block_and_release+12>
<_dispatch_client_callout+8>
<_dispatch_root_queue_drain+1829>
<dispatch_worker_thread3+111>
<pthread_wqthread+1129>
Oct 21 11:23:51 LuooFM[19236] : CGBitmapContextCreateImage: invalid context 0x0. Backtrace:
<TFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize13withTransformVSC17CGAffineTransform14drawTransposedSb20interpolatio
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize13withTransformVSC17CGAffineTransform14drawTransposedSb20interpola
<TFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+495>
<TToFE4NaviCSo7UIImage17navi_resizeToSizefS0_FTVSC6CGSize24withInterpolationQualityOSC22CGInterpolationQuality_GSqS0
+60
<TFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0+697>
<TToFE4NaviCSo7UIImage23navi_centerCropWithSizefS0_FVSC6CGSizeGSqS0+54>
<TFE4NaviCSo7UIImage25navi_avatarImageWithStylefS0_FOS_11AvatarStyleS0+733>
<TFFFFC4Navi9AvatarPodP33_8B0B5A6784EFC9FC4DDC7EE8BE0D2AF923completeRequestsWithURLFS0_FTCSo5NSURL5imageCSo7UIImage_T
<TTRXFo__dT__XFdCb__dT
+39>
<_dispatch_call_block_and_release+12>
<_dispatch_client_callout+8>
<_dispatch_root_queue_drain+1829>
<_dispatch_worker_thread3+111>
<_pthread_wqthread+1129>

@nixzhu
Copy link
Owner

nixzhu commented Oct 21, 2015

Thanks for test! Could you post your avatar's URL here?

@CodeEagle
Copy link
Author

@nixzhu
Copy link
Owner

nixzhu commented Oct 21, 2015

Please let me know if version 0.3.6 fixed this issue.

@CodeEagle
Copy link
Author

this still not work @ 0.3.6
image

@CodeEagle
Copy link
Author

这个实现的是否能取代当前的方法呢?
https://github.com/Alamofire/AlamofireImage/blob/master/Source/UIImage%2BAlamofireImage.swift

line 213

    UIGraphicsBeginImageContextWithOptions(size, false, 0.0)

    let scaledRadius = divideRadiusByImageScale ? radius / scale : radius

    let clippingPath = UIBezierPath(roundedRect: CGRect(origin: CGPointZero, size: size), cornerRadius: scaledRadius)
    clippingPath.addClip()

    drawInRect(CGRect(origin: CGPointZero, size: size))

    let roundedImage = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()

    return roundedImage

@nixzhu
Copy link
Owner

nixzhu commented Oct 21, 2015

@CodeEagle 请运行项目的 Demo,在 "Contacts" 里,最后两个是你提供的头像,样式为圆形,它们的格式正确吗?或者你自行调整至你需要的样式看看。 我暂时无法重现这个 bug。

@CodeEagle
Copy link
Author

hi,运行效果如下,最后一个是不行的。
image

@nixzhu
Copy link
Owner

nixzhu commented Oct 22, 2015

@CodeEagle 请问你测试机的 iOS 版本是多少?

@CodeEagle
Copy link
Author

@nixzhu 一直是用模拟器测试,

真机测试没问题,模拟器不通过

@kevinzhow
Copy link

@CodeEagle 试试把模拟器上的 App 删掉重新打开看效果,可能是缓存

@CodeEagle
Copy link
Author

@kevinzhow 不行,下载 Repo,运行,没有 Cache 的
Xcode7.1 iPhone Simulator 6s / iOS 9.1 (13B137)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants