Skip to content

Commit 90563cf

Browse files
ds8kDylanVann
authored andcommitted
fix: Fixes WebP rendering on iOS 12.
fixes issue #298 #385
1 parent c3492fc commit 90563cf

File tree

13 files changed

+131
-77
lines changed

13 files changed

+131
-77
lines changed

ios/Vendor/SDWebImage

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-fast-image",
3-
"version": "0.0.0-development",
3+
"version": "1.0.0-development",
44
"description": "🚩 FastImage, performant React Native image component.",
55
"keywords": [
66
"cache",

react-native-fast-image-example-cocoapods/ios/Podfile.lock

+40-10
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,38 @@ PODS:
77
- DoubleConversion
88
- glog
99
- glog (0.3.5)
10+
- libwebp (0.6.1):
11+
- libwebp/core (= 0.6.1)
12+
- libwebp/dec (= 0.6.1)
13+
- libwebp/demux (= 0.6.1)
14+
- libwebp/dsp (= 0.6.1)
15+
- libwebp/enc (= 0.6.1)
16+
- libwebp/mux (= 0.6.1)
17+
- libwebp/utils (= 0.6.1)
18+
- libwebp/webp (= 0.6.1)
19+
- libwebp/core (0.6.1):
20+
- libwebp/webp
21+
- libwebp/dec (0.6.1):
22+
- libwebp/core
23+
- libwebp/demux (0.6.1):
24+
- libwebp/core
25+
- libwebp/dsp (0.6.1):
26+
- libwebp/core
27+
- libwebp/enc (0.6.1):
28+
- libwebp/core
29+
- libwebp/mux (0.6.1):
30+
- libwebp/core
31+
- libwebp/utils (0.6.1):
32+
- libwebp/core
33+
- libwebp/webp (0.6.1)
1034
- React (0.57.3):
1135
- React/Core (= 0.57.3)
12-
- react-native-fast-image (5.0.10):
36+
- react-native-fast-image (1.0.0-development):
1337
- FLAnimatedImage
1438
- React
1539
- SDWebImage/Core
1640
- SDWebImage/GIF
41+
- SDWebImage/WebP
1742
- react-native-image-picker (0.27.1):
1843
- React
1944
- React/Core (0.57.3):
@@ -53,10 +78,13 @@ PODS:
5378
- React/RCTBlob
5479
- RNVectorIcons (6.0.2):
5580
- React
56-
- SDWebImage/Core (4.4.2)
57-
- SDWebImage/GIF (4.4.2):
81+
- SDWebImage/Core (4.4.5)
82+
- SDWebImage/GIF (4.4.5):
5883
- FLAnimatedImage (~> 1.0)
5984
- SDWebImage/Core
85+
- SDWebImage/WebP (4.4.5):
86+
- libwebp (~> 0.5)
87+
- SDWebImage/Core
6088
- yoga (0.57.3.React)
6189

6290
DEPENDENCIES:
@@ -80,6 +108,7 @@ SPEC REPOS:
80108
https://github.com/cocoapods/specs.git:
81109
- boost-for-react-native
82110
- FLAnimatedImage
111+
- libwebp
83112
- SDWebImage
84113

85114
EXTERNAL SOURCES:
@@ -106,13 +135,14 @@ SPEC CHECKSUMS:
106135
FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
107136
Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
108137
glog: e8acf0ebbf99759d3ff18c86c292a5898282dcde
109-
React: 1fe0eb13d90b625d94c3b117c274dcfd2e760e11
110-
react-native-fast-image: cba3d9bf9c2cf8ddb643d887a686c53a5dd90a2c
111-
react-native-image-picker: f42de90075c5b1af53417af927631d909a1a746e
112-
RNVectorIcons: 8c52e1e8da1153613fdef44748e865c25556cb9c
113-
SDWebImage: 624d6e296c69b244bcede364c72ae0430ac14681
114-
yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85
138+
libwebp: 0f01098c6c17175391af621b2f14150f3ca16e16
139+
React: a197ec4fee34abff321271f5614cabc517faed71
140+
react-native-fast-image: 996f6dc73f4b534ed6587513ad448aae5a48ccbe
141+
react-native-image-picker: 3fac3bf5b8ec802785c884c5bde0239ad8433b34
142+
RNVectorIcons: d819334932bcda3332deb3d2c8ea4d069e0b98f9
143+
SDWebImage: ecc03494e973b93b80213649d32175f8d2d17d4d
144+
yoga: c991dffbcb89c7eee1aadf243b72e48d462ee34a
115145

116146
PODFILE CHECKSUM: 9c1b580892a7e8ba16c3ef11342f53e075ff596a
117147

118-
COCOAPODS: 1.5.3
148+
COCOAPODS: 1.6.1

react-native-fast-image-example-cocoapods/ios/ReactNativeFastImageExampleCocoaPods.xcodeproj/project.pbxproj

+54-53
Large diffs are not rendered by default.

react-native-fast-image-example-cocoapods/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"react": "16.6.0-alpha.8af6728",
1111
"react-native": "0.57.3",
12-
"react-native-fast-image": "^5.0.11",
12+
"react-native-fast-image": "../react-native-fast-image-1.0.0-development.tgz",
1313
"react-native-image-picker": "^0.27.1",
1414
"react-native-image-progress": "^1.1.1",
1515
"react-native-status-bar-height": "^2.1.0",

react-native-fast-image-example-cocoapods/src/LocalImagesExample.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import Section from './Section'
66
import FeatureText from './FeatureText'
77
import FieldsImage from './images/fields.jpg'
88
import FieldsBase64 from './images/fields.js'
9+
import FieldsWebP from './images/fields.webp'
910
import JellyfishImage from './images/jellyfish.gif'
1011
import ImagePicker from 'react-native-image-picker'
1112
import BulletText from './BulletText'
1213

13-
var options = {
14+
const options = {
1415
title: 'Select Avatar',
1516
customButtons: [{ name: 'fb', title: 'Choose Photo from Facebook' }],
1617
storageOptions: {
@@ -94,6 +95,13 @@ const Base64 = () => (
9495
</React.Fragment>
9596
)
9697

98+
const WebP = () => (
99+
<React.Fragment>
100+
<BulletText>WebP</BulletText>
101+
<Image source={FieldsWebP} />
102+
</React.Fragment>
103+
)
104+
97105
const LocalImagesExample = ({ onPressReload, bust }) => (
98106
<View>
99107
<Section>
@@ -112,6 +120,9 @@ const LocalImagesExample = ({ onPressReload, bust }) => (
112120
<Row>
113121
<Base64 />
114122
</Row>
123+
<Row>
124+
<WebP />
125+
</Row>
115126
<PhotoExample />
116127
</View>
117128
</View>
Binary file not shown.

react-native-fast-image-example-cocoapods/yarn.lock

+3-4
Original file line numberDiff line numberDiff line change
@@ -4855,10 +4855,9 @@ [email protected]:
48554855
dependencies:
48564856
react-native-dismiss-keyboard "1.0.0"
48574857

4858-
react-native-fast-image@^5.0.11:
4859-
version "5.0.11"
4860-
resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-5.0.11.tgz#a8f21864d379e6f566e4f68dd04f2c0f7de0dfec"
4861-
integrity sha512-5NNQwRniOfSBAvKldyPEs1xotWxrFcplOSQiVc78dv/EhH4G0IpdrLtsQmBdB91EMtPQfvoT269sKqj5MJCgyA==
4858+
react-native-fast-image@../react-native-fast-image-1.0.0-development.tgz:
4859+
version "1.0.0-development"
4860+
resolved "../react-native-fast-image-1.0.0-development.tgz#725732e73654283d0efb8a24f0d6ef2a926e9374"
48624861

48634862
react-native-image-picker@^0.27.1:
48644863
version "0.27.1"

react-native-fast-image-example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"react": "16.6.0-alpha.8af6728",
1111
"react-native": "0.57.4",
12-
"react-native-fast-image": "../react-native-fast-image-5.1.0.tgz",
12+
"react-native-fast-image": "../react-native-fast-image-1.0.0-development.tgz",
1313
"react-native-image-picker": "^0.27.1",
1414
"react-native-image-progress": "^1.1.1",
1515
"react-native-status-bar-height": "^2.1.0",

react-native-fast-image-example/src/LocalImagesExample.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import Section from './Section'
66
import FeatureText from './FeatureText'
77
import FieldsImage from './images/fields.jpg'
88
import FieldsBase64 from './images/fields.js'
9+
import FieldsWebP from './images/fields.webp'
910
import JellyfishImage from './images/jellyfish.gif'
1011
import ImagePicker from 'react-native-image-picker'
1112
import BulletText from './BulletText'
1213

13-
var options = {
14+
const options = {
1415
title: 'Select Avatar',
1516
customButtons: [{ name: 'fb', title: 'Choose Photo from Facebook' }],
1617
storageOptions: {
@@ -41,9 +42,10 @@ class PhotoExample extends Component {
4142
response.customButton,
4243
)
4344
} else {
45+
const fileUri = `file://${response.path}`
4446
const uri = response.uri
4547
this.setState({
46-
image: { uri },
48+
image: { uri: uri },
4749
})
4850
}
4951
})
@@ -93,6 +95,13 @@ const Base64 = () => (
9395
</React.Fragment>
9496
)
9597

98+
const WebP = () => (
99+
<React.Fragment>
100+
<BulletText>WebP</BulletText>
101+
<Image source={FieldsWebP} />
102+
</React.Fragment>
103+
)
104+
96105
const LocalImagesExample = ({ onPressReload, bust }) => (
97106
<View>
98107
<Section>
@@ -111,6 +120,9 @@ const LocalImagesExample = ({ onPressReload, bust }) => (
111120
<Row>
112121
<Base64 />
113122
</Row>
123+
<Row>
124+
<WebP />
125+
</Row>
114126
<PhotoExample />
115127
</View>
116128
</View>
Binary file not shown.

react-native-fast-image-example/yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -4977,9 +4977,9 @@ [email protected]:
49774977
dependencies:
49784978
react-native-dismiss-keyboard "1.0.0"
49794979

4980-
react-native-fast-image@../react-native-fast-image-5.1.0.tgz:
4981-
version "5.1.0"
4982-
resolved "../react-native-fast-image-5.1.0.tgz#39ed466915a1e4fdd173f10530a9fdbb979cf937"
4980+
react-native-fast-image@../react-native-fast-image-1.0.0-development.tgz:
4981+
version "1.0.0-development"
4982+
resolved "../react-native-fast-image-1.0.0-development.tgz#725732e73654283d0efb8a24f0d6ef2a926e9374"
49834983

49844984
react-native-image-picker@^0.27.1:
49854985
version "0.27.1"

react-native-fast-image.podspec

+1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ Pod::Spec.new do |s|
2222
s.dependency 'React'
2323
s.dependency 'SDWebImage/Core'
2424
s.dependency 'SDWebImage/GIF'
25+
s.dependency 'SDWebImage/WebP'
2526
s.dependency 'FLAnimatedImage'
2627
end

0 commit comments

Comments
 (0)