Swift-WebP icon indicating copy to clipboard operation
Swift-WebP copied to clipboard

when I running on iOS simulator by Xcode, I got a fatal error

Open MorningStarJ opened this issue 5 years ago • 5 comments

the console said: dyld: Library not loaded: /usr/local/opt/webp/lib/libwebp.7.dylib Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/BDCB7B76-F51B-42D6-B6C2-0F8B66A889C6/data/Containers/Bundle/Application/EE7CB8B0-1477-43D8-B990-A0C8097B8C25/PracticeWebp.app/PracticeWebp Reason: no suitable image found. Did find: /usr/local/opt/webp/lib/libwebp.7.dylib: mach-o, but not built for iOS simulator

MorningStarJ avatar Jan 04 '20 16:01 MorningStarJ

@MorningStarJ Hi. What steps did you do to get that error?

ainame avatar Jan 15 '20 12:01 ainame

@MorningStarJ Hi. What steps did you do to get that error?

add Swift-Webp to the project by SPM,.

import UIKit
import WebP

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        let encoder = WebPEncoder()
        let queue = DispatchQueue(label: "do.something")
        queue.async {
            let data = try! encoder.encode(UIImage(named: "xxxx")!, config: WebPEncoderConfig.preset(WebPEncoderConfig.Preset.picture, quality: 100))
            print("encode successful")
        }
    }
}

run it on simulator, then the error is going to happen

MorningStarJ avatar Jan 19 '20 06:01 MorningStarJ

Did you get this fixed? I'd use SDWebImage but it seems kinda bloated for my use case as I only need the webp decrypt feature

Reiszecke avatar Jan 03 '21 09:01 Reiszecke

@Reiszecke No. I haven't worked on this project for a while. You are very welcome if you send me a patch to fix. I haven't tested this with Swift Package Manager's installation yet so it's likely to be broken somewhere.

ainame avatar Jan 03 '21 17:01 ainame

+1

maximkrouk avatar Jun 10 '21 14:06 maximkrouk