react-native-fast-image 8.6.38 → 8.6.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/RNFastImage.podspec
CHANGED
|
@@ -16,6 +16,9 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m}"
|
|
17
17
|
|
|
18
18
|
s.dependency 'React-Core'
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
# Any 5.x from 5.11.1, so apps can use newer versions (and share them with
|
|
20
|
+
# other libraries) without having to update. 5.18.7+ has the privacy
|
|
21
|
+
# manifest Apple requires.
|
|
22
|
+
s.dependency 'SDWebImage', '>= 5.11.1', '< 6.0'
|
|
23
|
+
s.dependency 'SDWebImageWebPCoder', '>= 0.8.4', '< 1.0'
|
|
21
24
|
end
|
package/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java
CHANGED
|
@@ -140,7 +140,10 @@ public class FastImageOkHttpProgressGlideModule extends LibraryGlideModule {
|
|
|
140
140
|
@Override
|
|
141
141
|
public void update(final String key, final long bytesRead, final long contentLength) {
|
|
142
142
|
final FastImageProgressListener listener = LISTENERS.get(key);
|
|
143
|
-
|
|
143
|
+
// Without a Content-Length the total is unknown (-1), and a
|
|
144
|
+
// percentage can't be worked out from it, so don't send those. (It
|
|
145
|
+
// also looked like the last update, which stopped all updates.)
|
|
146
|
+
if (listener == null || contentLength <= 0) {
|
|
144
147
|
return;
|
|
145
148
|
}
|
|
146
149
|
if (contentLength <= bytesRead) {
|
|
@@ -247,6 +247,11 @@
|
|
|
247
247
|
SDImageLoaderProgressBlock progress = nil;
|
|
248
248
|
if (self.onFastImageProgress) {
|
|
249
249
|
progress = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL* _Nullable targetURL) {
|
|
250
|
+
// Without a Content-Length the total is unknown (-1 or 0), and a
|
|
251
|
+
// percentage can't be worked out from it, so don't send those.
|
|
252
|
+
if (expectedSize <= 0) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
250
255
|
// SDWebImage calls this on its download queue, while React Native
|
|
251
256
|
// sets onFastImageProgress (and deallocates the view) on the main
|
|
252
257
|
// queue. Read and call it there, so it can't change or be released
|