expo-image 1.3.2 → 1.3.3

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/CHANGELOG.md CHANGED
@@ -10,6 +10,15 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 1.3.3 — 2023-09-15
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fixed placeholders aren't always replaced by full-size images on Android. ([#23705](https://github.com/expo/expo/pull/23705) by [@lukmccall](https://github.com/lukmccall))
18
+ - Fix the image components rendering incorrect assets when the Proguard is enabled on Android. ([#23704](https://github.com/expo/expo/pull/23704) by [@lukmccall](https://github.com/lukmccall))
19
+ - Fixed gif and awebp memory leak on Android. ([#24259](https://github.com/expo/expo/pull/24259) by [@jingpeng](https://github.com/jingpeng))
20
+ - Suppress "Operation cancelled by user during sending the request" error when the load request is canceled (interrupted) by a new one. ([#24279](https://github.com/expo/expo/pull/24279) by [@tsapeta](https://github.com/tsapeta))
21
+
13
22
  ## 1.3.2 — 2023-07-12
14
23
 
15
24
  ### 🐛 Bug fixes
@@ -50,7 +50,8 @@ android {
50
50
  minSdkVersion safeExtGet("minSdkVersion", 21)
51
51
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
52
52
  versionCode 1
53
- versionName "1.3.2"
53
+ versionName "1.3.3"
54
+ consumerProguardFiles("proguard-rules.pro")
54
55
  }
55
56
  lintOptions {
56
57
  abortOnError false
@@ -96,7 +97,7 @@ dependencies {
96
97
  kapt "com.github.bumptech.glide:compiler:${GLIDE_VERSION}"
97
98
  api 'com.caverock:androidsvg-aar:1.4'
98
99
 
99
- implementation "com.github.penfeizhou.android.animation:glide-plugin:2.24.0"
100
+ implementation "com.github.penfeizhou.android.animation:glide-plugin:2.28.0"
100
101
  implementation "com.github.bumptech.glide:avif-integration:${GLIDE_VERSION}"
101
102
 
102
103
  api 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
@@ -1,25 +1,28 @@
1
1
  # https://bumptech.github.io/glide/doc/download-setup.html#proguard
2
2
 
3
- -keep public class * implements com.bumptech.glide.module.LibraryGlideModule
3
+ -keep public class * extends com.bumptech.glide.module.LibraryGlideModule
4
4
  -keep public class * implements com.bumptech.glide.module.GlideModule
5
- -keep public class * extends com.bumptech.glide.module.AppGlideModule
5
+ -keep class * extends com.bumptech.glide.module.AppGlideModule {
6
+ <init>(...);
7
+ }
6
8
  -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
7
9
  **[] $VALUES;
8
10
  public *;
9
11
  }
12
+ -keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
13
+ *** rewind();
14
+ }
15
+
16
+ -keep public class com.bumptech.glide.request.ThumbnailRequestCoordinator {
17
+ *;
18
+ }
10
19
 
11
20
  -dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
12
21
 
13
22
  # https://bumptech.github.io/glide/doc/configuration.html#applications
14
23
 
15
- -keep public class * extends com.bumptech.glide.module.AppGlideModule
16
- -keep public class expo.modules.image.svg.SVGModule
17
24
  -keep class com.bumptech.glide.GeneratedAppGlideModuleImpl
18
25
 
19
26
  -keep public class com.bumptech.glide.integration.webp.WebpImage { *; }
20
27
  -keep public class com.bumptech.glide.integration.webp.WebpFrame { *; }
21
28
  -keep public class com.bumptech.glide.integration.webp.WebpBitmapFactory { *; }
22
-
23
- -keep public class com.bumptech.glide.requestThumbnailRequestCoordinator {
24
- *;
25
- }
@@ -316,7 +316,12 @@ class ExpoImageViewWrapper(context: Context, appContext: AppContext) : ExpoView(
316
316
 
317
317
  firstView
318
318
  .recycleView()
319
- ?.clear(requestManager)
319
+ ?.apply {
320
+ // The current target is already bound to the view. We don't want to cancel it in that case.
321
+ if (this != target) {
322
+ clear(requestManager)
323
+ }
324
+ }
320
325
 
321
326
  configureView(firstView, target, resource, isPlaceholder)
322
327
  if (transitionDuration > 0) {
@@ -73,7 +73,7 @@ class ImageViewWrapperTarget(
73
73
  val isPlaceholder = if (request is ThumbnailRequestCoordinator) {
74
74
  (request as? ThumbnailRequestCoordinator)
75
75
  ?.getPrivateFullRequest()
76
- ?.isComplete != true
76
+ ?.isComplete == false
77
77
  } else {
78
78
  false
79
79
  }
@@ -1,18 +1,21 @@
1
1
  package expo.modules.image
2
2
 
3
+ import android.util.Log
3
4
  import com.bumptech.glide.request.Request
4
5
  import com.bumptech.glide.request.ThumbnailRequestCoordinator
5
6
 
6
7
  fun ThumbnailRequestCoordinator.getPrivateFullRequest(): Request? {
7
- return getPrivateRequest("full")
8
+ return getPrivateFiled("full")
8
9
  }
9
10
 
10
- private fun ThumbnailRequestCoordinator.getPrivateRequest(name: String): Request? {
11
+ private fun <T> ThumbnailRequestCoordinator.getPrivateFiled(name: String): T? {
11
12
  return try {
12
13
  val filed = this.javaClass.getDeclaredField(name)
13
14
  filed.isAccessible = true
14
- filed.get(this) as Request
15
+ @Suppress("UNCHECKED_CAST")
16
+ filed.get(this) as T
15
17
  } catch (e: Throwable) {
18
+ Log.e("ExpoImage", "Couldn't receive the `$name` field", e)
16
19
  null
17
20
  }
18
21
  }
@@ -197,7 +197,13 @@ public final class ImageView: ExpoView {
197
197
  _ imageUrl: URL?
198
198
  ) {
199
199
  if let error = error {
200
- onError(["error": error.localizedDescription])
200
+ let code = (error as NSError).code
201
+
202
+ // SDWebImage throws an error when loading operation is canceled (interrupted) by another load request.
203
+ // We do want to ignore that one and wait for the new request to load.
204
+ if code != SDWebImageError.cancelled.rawValue {
205
+ onError(["error": error.localizedDescription])
206
+ }
201
207
  return
202
208
  }
203
209
  guard finished else {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-image",
3
3
  "title": "Expo Image",
4
- "version": "1.3.2",
4
+ "version": "1.3.3",
5
5
  "description": "A cross-platform, performant image component for React Native and Expo with Web support",
6
6
  "main": "build/index.js",
7
7
  "types": "build/index.d.ts",
@@ -33,5 +33,5 @@
33
33
  "peerDependencies": {
34
34
  "expo": "*"
35
35
  },
36
- "gitHead": "8fdc53c90c52242a80ea511ee3073d9ab950bc68"
36
+ "gitHead": "0fa20c9cbad0c73a30089ffc09073e6d94a6dabb"
37
37
  }