Coder Social home page Coder Social logo

Comments (14)

nonzar avatar nonzar commented on August 16, 2024

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

from simple-crop.

newbieYoung avatar newbieYoung commented on August 16, 2024

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

from simple-crop.

KanadeCCCC avatar KanadeCCCC commented on August 16, 2024

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

from simple-crop.

newbieYoung avatar newbieYoung commented on August 16, 2024

from simple-crop.

liangzq1 avatar liangzq1 commented on August 16, 2024

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

---原始邮件--- 发件人: "CLC KANADE"<[email protected]> 发送时间: 2020年10月14日(周三) 下午5:46 收件人: "newbieYoung/Simple-Crop"<[email protected]>; 抄送: "Mention"<[email protected]>;"Young"<[email protected]>; 主题: 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不选原图也显示不了阿,请问有其他办法解决吗?

from simple-crop.

newbieYoung avatar newbieYoung commented on August 16, 2024

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

from simple-crop.

liangzq1 avatar liangzq1 commented on August 16, 2024

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

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

from simple-crop.

newbieYoung avatar newbieYoung commented on August 16, 2024

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

from simple-crop.

liangzq1 avatar liangzq1 commented on August 16, 2024

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

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

from simple-crop.

tenbamboo avatar tenbamboo commented on August 16, 2024

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

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

from simple-crop.

liangzq1 avatar liangzq1 commented on August 16, 2024

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

from simple-crop.

 avatar commented on August 16, 2024

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

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

from simple-crop.

xiaoerchou avatar xiaoerchou commented on August 16, 2024

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

from simple-crop.

misscx avatar misscx commented on August 16, 2024

from simple-crop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.