expo-image 2.0.6 → 2.0.7

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,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 2.0.7 — 2025-03-26
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [iOS] Fixed image be cropped with `contentPosition` on New Architecture mode. ([#35630](https://github.com/expo/expo/pull/35630) by [@kudo](https://github.com/kudo))
18
+
13
19
  ## 2.0.6 — 2025-02-19
14
20
 
15
21
  ### 🐛 Bug fixes
@@ -18,7 +18,7 @@ android {
18
18
  namespace "expo.modules.image"
19
19
  defaultConfig {
20
20
  versionCode 1
21
- versionName "2.0.6"
21
+ versionName "2.0.7"
22
22
  consumerProguardFiles("proguard-rules.pro")
23
23
 
24
24
  buildConfigField("boolean", "ALLOW_GLIDE_LOGS", project.properties.get("EXPO_ALLOW_GLIDE_LOGS", "false"))
@@ -362,7 +362,20 @@ public final class ImageView: ExpoView {
362
362
  */
363
363
  private func applyContentPosition(contentSize: CGSize, containerSize: CGSize) {
364
364
  let offset = contentPosition.offset(contentSize: contentSize, containerSize: containerSize)
365
- sdImageView.layer.frame.origin = offset
365
+ if sdImageView.layer.mask != nil {
366
+ // In New Architecture mode, React Native adds a mask layer to image subviews.
367
+ // When moving the layer frame, we must move the mask layer with a compensation value.
368
+ // This prevents the layer from being cropped.
369
+ // See https://github.com/expo/expo/issues/34201
370
+ // and https://github.com/facebook/react-native/blob/c72d4c5ee97/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L1066-L1076
371
+ CATransaction.begin()
372
+ CATransaction.setDisableActions(true)
373
+ sdImageView.layer.frame.origin = offset
374
+ sdImageView.layer.mask?.frame.origin = CGPoint(x: -offset.x, y: -offset.y)
375
+ CATransaction.commit()
376
+ } else {
377
+ sdImageView.layer.frame.origin = offset
378
+ }
366
379
  }
367
380
 
368
381
  internal func renderSourceImage(_ image: UIImage?) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-image",
3
3
  "title": "Expo Image",
4
- "version": "2.0.6",
4
+ "version": "2.0.7",
5
5
  "description": "A cross-platform, performant image component for React Native and Expo with Web support",
6
6
  "main": "src/index.ts",
7
7
  "types": "build/index.d.ts",
@@ -41,5 +41,5 @@
41
41
  "optional": true
42
42
  }
43
43
  },
44
- "gitHead": "c01c449a1d6e6e8690bfcc88a778b46781a59674"
44
+ "gitHead": "5f0263343cdcddf406eb01fe2fb68182be041fd9"
45
45
  }