Giter VIP home page Giter VIP logo

Comments (8)

zhangao0086 avatar zhangao0086 commented on May 27, 2024 1

Try this:

pickerController.didSelectAssets = { (assets: [DKAsset]) in
    print(assets.count)

    dispatch_async(dispatch_get_global_queue(0, 0), {
        let options = PHImageRequestOptions()
        options.deliveryMode = .HighQualityFormat
        options.synchronous = true

        for (_, asset) in assets.enumerate() {
            asset.fetchImageWithSize(PHImageManagerMaximumSize, options: options) { image, info in
                self.images.append(image!)
            }
        }

        print(self.images.count)
    })
}

from dkimagepickercontroller.

zhangao0086 avatar zhangao0086 commented on May 27, 2024

The fetchOriginalImageWithCompleteBlock method is executed on a background thread. You should print the self.images.count after the all fetchOriginalImageWithCompleteBlock are completed.

from dkimagepickercontroller.

davin12x avatar davin12x commented on May 27, 2024

it still same .. But when i use this code
for asset in assets {
asset.fetchImageWithSize(CGSize(width: 200, height: 200), options: PHImageRequestOptions?.init(), completeBlock: { (image, info) -> Void in
self.images.append(image!)
})
This give me all the value. When i change the CZsize according to original image. Then it again gives me less value

from dkimagepickercontroller.

davin12x avatar davin12x commented on May 27, 2024

scren
thanks for replying . i used this code and most of time it crashed when selecting more than 1 photo..But some time it works ..

from dkimagepickercontroller.

zhangao0086 avatar zhangao0086 commented on May 27, 2024

Could you post the error stacktrace?

from dkimagepickercontroller.

davin12x avatar davin12x commented on May 27, 2024

stack trace
i think i have infinite loop is going on there...I really appreciate that you are helping me

As you can see i selected 19 photos there

from dkimagepickercontroller.

zhangao0086 avatar zhangao0086 commented on May 27, 2024

Could you try to replace the condition

if let isInCloud = info?[PHImageResultIsInCloudKey]?.boolValue
    where isInCloud && self.autoDownloadWhenAssetIsInCloud {

to

if let isInCloud = info?[PHImageResultIsInCloudKey]?.boolValue
    where image == nil && isInCloud && self.autoDownloadWhenAssetIsInCloud {

Let me know if that works :)

from dkimagepickercontroller.

davin12x avatar davin12x commented on May 27, 2024

You are awesome. THANKS A LOT !!!! YOU saved my life. I was scratching my head ..calling my self totaly dumb..Thanks ..So the problem was downloading images from cloud ..Thanks Again

from dkimagepickercontroller.

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.