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

IOS14.0.1微信小程序选择照片,不显示图片。 #28

Open
KanadeCCCC opened this issue Oct 13, 2020 · 14 comments
Open

IOS14.0.1微信小程序选择照片,不显示图片。 #28

KanadeCCCC opened this issue Oct 13, 2020 · 14 comments

Comments

@KanadeCCCC
Copy link

微信开发者工具可以显示,但部分真机无法显示,不显示的机型包括: iphone xs, iphone11 pro max,反复测试后,不管是杀死微信还是移除小程序,安卓与ios均会出现拍照后上传图片至组件,回调函数不被调用。以上问题均未出现任何报错与错误日志,望解决

@nonzar
Copy link

nonzar commented Oct 13, 2020

貌似小程序内核升级造成的,尺寸太大的图片会有问题,可以先在index.js的load函数的wx.getImageInfo回调里,把图片尺寸缩小一半。
res.width=Math.round(res.width/2)
res.height=Math.round(res.height/2)

@newbieYoung
Copy link
Owner

@KanadeCCCC 方便给个代码片段吗?

@KanadeCCCC
Copy link
Author

貌似小程序内核升级造成的,尺寸太大的图片会有问题,可以先在index.js的load函数的wx.getImageInfo回调里,把图片尺寸缩小一半。
res.width=Math.round(res.width/2)
res.height=Math.round(res.height/2)
@newbieYoung
通过这个方式成功解决了问题,不过这算是妥协方案了,图片清晰度要降低不少。

@newbieYoung
Copy link
Owner

newbieYoung commented Oct 14, 2020 via email

@liangzq1
Copy link

liangzq1 commented Dec 8, 2020

嗯嗯,这个组件在图片尺寸和体积很大的时候是会问题,示例小程序里边都限制了不能选取原图

---原始邮件--- 发件人: "CLC KANADE"<notifications@github.com> 发送时间: 2020年10月14日(周三) 下午5:46 收件人: "newbieYoung/Simple-Crop"<Simple-Crop@noreply.github.com>; 抄送: "Mention"<mention@noreply.github.com>;"Young"<657851574@qq.com>; 主题: Re: [newbieYoung/Simple-Crop] IOS14.0.1微信小程序选择照片,不显示图片。 (#28) 貌似小程序内核升级造成的,尺寸太大的图片会有问题,可以先在index.js的load函数的wx.getImageInfo回调里,把图片尺寸缩小一半。 res.width=Math.round(res.width/2) res.height=Math.round(res.height/2) @newbieYoung 通过这个方式成功解决了问题,不过这算是妥协方案了,图片清晰度要降低不少。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

@newbieYoung
我IOS不选原图也显示不了阿,请问有其他办法解决吗?

@newbieYoung
Copy link
Owner

@liangzq1 你试用下 simplecrop 小程序也会有问题吗?

@liangzq1
Copy link

@liangzq1 你试用下 simplecrop 小程序也会有问题吗?
@nonzar 貌似小程序内核升级造成的,尺寸太大的图片会有问题,可以先在index.js的load函数的wx.getImageInfo回调里,把图片尺寸缩小一半。
res.width=Math.round(res.width/2)
res.height=Math.round(res.height/2)

用的就是simpleCrop阿,即使不是原图,图片尺寸太大也会显示不出来,我也是通过上面的这种方式解决了,不过把图片尺寸缩小会影响清晰度,能有其他解决办法吗?

@newbieYoung
Copy link
Owner

@liangzq1 麻烦告诉下设备和图片信息

@liangzq1
Copy link

liangzq1 commented Dec 11, 2020

@liangzq1 麻烦告诉下设备和图片信息

@newbieYoung 手机iphone7 Plus 系统为IOS10.2 ,图片原图为1920*1080,大小为399KB,在编辑器可以正常显示,真机无法显示。
微信图片_20201211184813

@tenbamboo
Copy link

tenbamboo commented Dec 18, 2020

我这边,是IOS 14.3(XS) 也是不好用,然后使用楼上的方法,IOS就好用了

res.width=Math.round(res.width/2)
res.height=Math.round(res.height/2)

@liangzq1
Copy link

貌似小程序内核升级造成的,尺寸太大的图片会有问题,可以先在index.js的load函数的wx.getImageInfo回调里,把图片尺寸缩小一半。
res.width=Math.round(res.width/2)
res.height=Math.round(res.height/2)
@newbieYoung
通过这个方式成功解决了问题,不过这算是妥协方案了,图片清晰度要降低不少。
@newbieYoung
清晰度这个问题能修复吗?

@ghost
Copy link

ghost commented Apr 15, 2021

iOS 14.2, iPhone 12 mini 也无法正常工作!

说下我遇到的问题的解决办法, 使用tempFiles对象中的path属性, 而不是使用tempFilePaths, 因为iOS的image不能加载微信的wxfile://协议引用的tmp临时文件

@xiaoerchou
Copy link

现在 我看tempFilePaths 和 tempFiles 中都是返回的 wxfile://协议引用的tmp临时文件
@newbieYoung

@misscx
Copy link

misscx commented Sep 10, 2022 via email

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

7 participants