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

iOS17崩溃:UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=1.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert. #1674

Open
ipad4 opened this issue Apr 1, 2024 · 6 comments

Comments

@ipad4
Copy link

ipad4 commented Apr 1, 2024

提bug前必看
请先回答下列三个问题,否则不允处理,谢谢配合。
1、我最新的Demo是否有这个bug?【如果Demo没问题,请升级新版
答:有

2、你用的是什么版本?升级到最新版后是否正常?
答:3.8.4

3、是否有改动过我库内部的代码?【如有,请说明改动点
答:无

bug内容描述
UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=1.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.

我如何复现这个bug?
传入尺寸为0的图片

截图
image

其它说明

@lxm1799
Copy link

lxm1799 commented Apr 2, 2024

这个应该是适配iOS15的bug,参考文献:https://juejin.cn/post/7280747833383878711?searchId=20240402160126586290D789B3BF9F7AFB

@banchichen
Copy link
Owner

什么情况下,会去绘制尺寸为0的图片呢?

@ipad4
Copy link
Author

ipad4 commented Jun 27, 2024

什么情况下,会去绘制尺寸为0的图片呢?

视频缩略图可能出现这种情况

@banchichen
Copy link
Owner

@ipad4 你目前是怎么处理的呢?图片size为0时,不调scaleImage?

@ipad4
Copy link
Author

ipad4 commented Jul 1, 2024

@ipad4 你目前是怎么处理的呢?图片size为0时,不调scaleImage?

hook这个方法,size为0时不处理

@lxm1799
Copy link

lxm1799 commented Jul 1, 2024

@ipad4 你目前是怎么处理的呢?图片size为0时,不调scaleImage?

Pasted Graphic
改成最新的系统方法即可。
https://juejin.cn/post/7280747833383878711?searchId=20240402160126586290D789B3BF9F7AFB

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