Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebP with 6.0.0 #476

Closed
pontusab opened this issue May 15, 2019 · 12 comments
Closed

WebP with 6.0.0 #476

pontusab opened this issue May 15, 2019 · 12 comments
Labels

Comments

@pontusab
Copy link

  • React Native version: v0.59.8
  • React version: 16.8.6
  • React Native Fast Image version: 6.0.0

In the latest release using cocapods and WebP the images are not displayed at all. Downgrading to 5.4.2 works just fine.

I guess there is something with SDWebImage that needs to be patched?

@pontusab pontusab added the bug label May 15, 2019
@guhungry
Copy link
Contributor

Please refer to #454 (comment)

@pontusab
Copy link
Author

Yes, tried that. Did not work, did it work for you then @guhungry ?

@guhungry
Copy link
Contributor

guhungry commented May 24, 2019

Nope, I didn't use webp in my app. Maybe you need to ping author of #454.

@Ilphrin
Copy link

Ilphrin commented May 28, 2019

Seems like SDWebImage have its support disabled by default (See https://stackoverflow.com/questions/18012527/how-to-load-a-webp-image-with-sdwebimage ) Maybe you can try something like one of the answers @pontusab ?

@dreampiggy
Copy link
Contributor

dreampiggy commented Jun 2, 2019

@pontusab See SDWebImageWebPCoder Readme.

For 5.0, all the external image format coders, are standalone modules (Pods). If you want to use WebP, you can add the Pods and register it in AppDelegate.m.

pod 'react-native-fast-image'
pod 'SDWebImageWebPCoder'
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...
    // Register WebP format support
    [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
    // ...
}

@pontusab
Copy link
Author

pontusab commented Jun 2, 2019

Thanks, I got it to work 🥇

@pontusab
Copy link
Author

pontusab commented Jun 8, 2019

Import in AppDelegate.m:

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

An add:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...
    // Register WebP format support
    [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
    // ...
}

@aibrahim3546
Copy link

@pontusab What is the step you do to get it works?

I did like this

  • add pod 'SDWebImageWebPCoder'
  • run pod install

and then in AppDelegate.m

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

// .....

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...
    // Register WebP format support
    [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
    // ...
}

//....

I cannot build the App. It failed.

@dancomanlive
Copy link

@aibrahim3546 What is the error msg? Try pod deintegrate before pod install maybe. The solution above worked for me just fine.

@fondoger
Copy link

Thanks, it works perfectly for me!

@vinceprofeta
Copy link

For react native v0.60 - make sure to run pod update

@srajesh636
Copy link

Import in AppDelegate.m:

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

An add:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...
    // Register WebP format support
    [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
    // ...
}

Thanks, it Worked like charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants