Giter VIP home page Giter VIP logo

Comments (2)

qingmei2 avatar qingmei2 commented on July 29, 2024

OOM原因应该是Bitmap所占的内存太大了。

这是严重的bug,我会尽快修正这个bug并发布下一个版本。

from rximagepicker.

qingmei2 avatar qingmei2 commented on July 29, 2024

已修正。

问题发生的原因在于,0.3.0版本之前的@AsBitmap处理逻辑,将Uri转换为Bitmap时,并未进行压缩处理。这样会导致在多选图片时,过多的图片短时间同时转换为Bitmap对象,导致OOM的发生。

@AsBitmap和@AsFile有着导致程序 不可控行为 发生的可能性,这个情况在 基础库 中并未表现,随着拓展库的增加,该类型注解愈发暴露出问题。

以@AsBitmap 为例,这个注解会标记返回值为Bitmap类型,但是当用户在 知乎主题UI界面 点击选择 某个 视频文件 时,这可能会导致程序的 崩溃

这是有临时的解决方案的,比如可以建议开发者 在这种情况下仅配置 @AsUri注解,但是这毫无意义,一个有 限制性 的API意味着 架构设计的不足。

因此我考虑再三决定移除 该注解,修正后的版本(After 0.3.0),RxImagePicker都将默认返回Uri类型的数据,这样避免OOM的同时,方便开发者轻松处理不同类型的文件(image/video等等)。

遇到该问题的同学请尽快升级v0.3.0,更详细的调整请参考 更新日志

from rximagepicker.

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.