How to maintain WebP images in native response?

I need to show .WebP images with image extension in my reaction based application. I work on iOS and do not show any image. I googled and found some information saying that WebP images would not be supported on iOS and should use a library or have to write an extension to support this. I used this reaction-native library to support webP . However, I do not understand. Can anyone consult on this? How to do it?

Note: Do not put this as a duplicate. I already checked StackOverflow and did not find the answer. The problem may be similar to https://stackoverflow.com/a/318960/

+8
source share
2 answers

I was able to add webp support to my own application using the related article and repo

  1. yarn add TGPSKI/react-native-webp-support
  2. Open your project in Xcode
  3. Add WebP.framework and WebPDemux.framework from node_modules / react-native-webp-support / to your project files (right-click your project and select "Add Files To ...")
  4. Add WebP.framework and WebPDemux.framework to your related frameworks and libraries on the General tab of your main project goal.
  5. Add "$ (SRCROOT) /../ node_modules / react-native-webp-support" to your Framework search paths located on the Build Settings tab of your main project goal.
  6. Add $ (SRCROOT) /../ node_modules / react-native-webp-support to your header search paths located on the Build Settings tab of your main project goal
  7. Add ReactNativeWebp.xcodeproj from node_modules / react-native-webp-support / to your project files (right-click your project and select "Add Files To ...")
  8. Add libReactNatveWebp.a to libReactNatveWebp.a Link Binary with Libraries, located on the Build Phases tab of your main project goal.
  9. Create a new binary file and use .webp images

https://medium.com/@tgpski/react-native-webp-reducing-bundle-binary-sizes-increase-speed-with-webp-image-format-aa9b1aa11405

https://github.com/TGPSKI/react-native-webp-support

+4
source

After following the steps above, the application crashes unexpectedly when I try to use Image Comp.

0
source

Source: https://habr.com/ru/post/1269786/


All Articles