v0.59.816.8.66.0.0In 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?
Yes, tried that. Did not work, did it work for you then @guhungry ?
Nope, I didn't use webp in my app. Maybe you need to ping author of https://github.com/DylanVann/react-native-fast-image/pull/454.
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 ?
@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];
// ...
}
Thanks, I got it to work 馃
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];
// ...
}
@pontusab What is the step you do to get it works?
I did like this
pod 'SDWebImageWebPCoder'pod installand 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.
@aibrahim3546 What is the error msg? Try pod deintegrate before pod install maybe. The solution above worked for me just fine.
Thanks, it works perfectly for me!
For react native v0.60 - make sure to run pod update
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
Most helpful comment
Import in
AppDelegate.m:An add: