react-native-fast-image 8.6.14 → 8.6.15

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.
@@ -1,6 +1,7 @@
1
1
  package com.dylanvann.fastimage;
2
2
 
3
3
  import android.app.Activity;
4
+ import android.util.Log;
4
5
 
5
6
  import androidx.annotation.NonNull;
6
7
 
@@ -17,6 +18,7 @@ import com.facebook.react.views.imagehelper.ImageSource;
17
18
  class FastImageViewModule extends ReactContextBaseJavaModule {
18
19
 
19
20
  private static final String REACT_CLASS = "FastImageView";
21
+ private static final String TAG = "FastImage";
20
22
 
21
23
  FastImageViewModule(ReactApplicationContext reactContext) {
22
24
  super(reactContext);
@@ -38,8 +40,18 @@ class FastImageViewModule extends ReactContextBaseJavaModule {
38
40
  for (int i = 0; i < sources.size(); i++) {
39
41
  final ReadableMap source = sources.getMap(i);
40
42
  // Skip sources without a uri (Glide throws on an empty url).
41
- if (!FastImageViewConverter.hasUri(source)) continue;
43
+ // preload has no way to report errors, so log them.
44
+ if (!FastImageViewConverter.hasUri(source)) {
45
+ Log.w(TAG, "preload: skipping a source without a uri");
46
+ continue;
47
+ }
42
48
  final FastImageSource imageSource = FastImageViewConverter.getImageSource(activity, source);
49
+ // Also skip a uri that can't be resolved (e.g. a relative path),
50
+ // which resolves to an empty one. The view reports it as an error.
51
+ if (imageSource.getUri().toString().isEmpty()) {
52
+ Log.w(TAG, "preload: skipping a uri that can't be resolved: " + source.getString("uri"));
53
+ continue;
54
+ }
43
55
 
44
56
  Glide
45
57
  .with(activity.getApplicationContext())
@@ -1,5 +1,6 @@
1
1
  #import "FFFastImageViewManager.h"
2
2
  #import "FFFastImageView.h"
3
+ #import <React/RCTLog.h>
3
4
 
4
5
  #import <SDWebImage/SDImageCache.h>
5
6
  #import <SDWebImage/SDWebImagePrefetcher.h>
@@ -30,6 +31,8 @@ RCT_EXPORT_METHOD(preload:(nonnull NSArray<FFFastImageSource *> *)sources)
30
31
  // Skip sources without a url (an empty, missing or null uri). NSArray can't
31
32
  // hold nil, so adding one throws and crashes the app.
32
33
  if (!source.url) {
34
+ // preload has no way to report errors, so log it.
35
+ RCTLogWarn(@"FastImage.preload: skipping a source without a valid uri");
33
36
  return;
34
37
  }
35
38
  [source.headers enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString* header, BOOL *stop) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-fast-image",
3
- "version": "8.6.14",
3
+ "version": "8.6.15",
4
4
  "description": "🚩 FastImage, performant React Native image component.",
5
5
  "keywords": [
6
6
  "cache",