Code Monkey home page Code Monkey logo

Comments (11)

SilenceLove avatar SilenceLove commented on August 17, 2024

你怎么算的

from hxphotopicker.

hubin97 avatar hubin97 commented on August 17, 2024

就是后面那段代码, 选完资源回调, 使用 PhotoAsset的 fileSize求和算的, 我看到你库里面有写1000_1000 = 1MB的, 而我使用 求和的值/1000_100 才和 选图时勾选原图后边那个计算总大小相近; 不知道是不是哪里出了问题

  func updateLayout(_ assetMetas: [PhotoAsset]) {
        let totalFileSize = assetMetas.reduce(0) { partialResult, aMeta in
            return partialResult + aMeta.fileSize
        }/1000_100
}

from hxphotopicker.

SilenceLove avatar SilenceLove commented on August 17, 2024

你看你计算方式有没有问题吧

from hxphotopicker.

hubin97 avatar hubin97 commented on August 17, 2024

计算应该没有问题, 就是拿的fileSize求和;
确认下, fileSize 在勾选或者不勾选原图时, 它的返回数值没有变?

from hxphotopicker.

SilenceLove avatar SilenceLove commented on August 17, 2024

没有

from hxphotopicker.

SilenceLove avatar SilenceLove commented on August 17, 2024

不都是90吗

from hxphotopicker.

hubin97 avatar hubin97 commented on August 17, 2024

不都是90吗

因为我除的不是 1000_1000 呀

from hxphotopicker.

SilenceLove avatar SilenceLove commented on August 17, 2024

返回的是字节 肯定要除啊
/1000 = 1Kb
/1000000 = 1Mb

from hxphotopicker.

hubin97 avatar hubin97 commented on August 17, 2024

返回的是字节 肯定要除啊 /1000 = 1Kb /1000000 = 1Mb

所以如果除1000000, 结果就差了10倍了

from hxphotopicker.

SilenceLove avatar SilenceLove commented on August 17, 2024

from hxphotopicker.

hubin97 avatar hubin97 commented on August 17, 2024

1

from hxphotopicker.

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.