expo-image 2.4.0-canary-20250713-8f814f8 → 2.4.0
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 +15 -18
- package/android/build.gradle +1 -1
- package/android/src/main/java/expo/modules/image/ExpoImageModule.kt +0 -20
- package/android/src/main/java/expo/modules/image/ExpoImageViewWrapper.kt +5 -24
- package/android/src/main/java/expo/modules/image/blurhash/BlurhashDecoder.kt +10 -1
- package/android/src/main/java/expo/modules/image/okhttp/GlideUrlWrapperLoader.kt +1 -1
- package/build/ExpoImage.web.d.ts +1 -1
- package/build/ExpoImage.web.d.ts.map +1 -1
- package/build/Image.d.ts +2 -3
- package/build/Image.d.ts.map +1 -1
- package/build/Image.types.d.ts +5 -9
- package/build/Image.types.d.ts.map +1 -1
- package/build/web/ImageWrapper.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/ExpoImage.podspec +1 -1
- package/ios/ImageModule.swift +11 -20
- package/ios/ImageView.swift +3 -5
- package/ios/Loaders/PhotoLibraryAssetLoader.swift +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/{2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8-sources.jar → 2.4.0/expo.modules.image-2.4.0-sources.jar} +0 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0-sources.jar.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0-sources.jar.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0-sources.jar.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0-sources.jar.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar +0 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/{2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.module → 2.4.0/expo.modules.image-2.4.0.module} +24 -24
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/{2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.pom → 2.4.0/expo.modules.image-2.4.0.pom} +2 -2
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.pom.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.pom.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.pom.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.pom.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml +4 -4
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.sha512 +1 -1
- package/package.json +5 -4
- package/src/ExpoImage.web.tsx +1 -2
- package/src/Image.tsx +3 -4
- package/src/Image.types.ts +5 -9
- package/src/web/ImageWrapper.tsx +1 -8
- package/android/src/main/java/expo/modules/image/blurhash/BlurhashEncoder.kt +0 -112
- package/android/src/main/java/expo/modules/image/blurhash/BlurhashHelpers.kt +0 -38
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8-sources.jar.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8-sources.jar.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8-sources.jar.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8-sources.jar.sha512 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.aar +0 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.aar.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.aar.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.aar.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.aar.sha512 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.module.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.module.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.module.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.module.sha512 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.pom.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.pom.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.pom.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.4.0-canary-20250713-8f814f8/expo.modules.image-2.4.0-canary-20250713-8f814f8.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,27 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
### 🎉 New features
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
### 🐛 Bug fixes
|
|
10
|
+
|
|
11
|
+
### 💡 Others
|
|
12
|
+
|
|
13
|
+
## 2.4.0 — 2025-07-17
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
11
17
|
- [iOS] Add a new prop - `enforceEarlyResizing` to reduce the memory usage of the image view. ([#37909](https://github.com/expo/expo/pull/37909) by [@lukmccall](https://github.com/lukmccall))
|
|
12
18
|
|
|
13
19
|
### 🐛 Bug fixes
|
|
14
20
|
|
|
15
21
|
- [iOS] Speed up displaying local assets. ([#37795](https://github.com/expo/expo/pull/37795) by [@aleqsio](https://github.com/aleqsio))
|
|
16
|
-
- [
|
|
17
|
-
- [Web] Fix `alt` as an alias for `accessibilityLabel` ([#37682](https://github.com/expo/expo/pull/37682) by [@huextrat](https://github.com/huextrat))
|
|
18
|
-
|
|
19
|
-
### 💡 Others
|
|
20
|
-
|
|
21
|
-
### 📚 3rd party library updates
|
|
22
|
+
- [iOS] Fix some operation were incorrectly cancelled. ([#37987](https://github.com/expo/expo/pull/37987) by [@lukmccall](https://github.com/lukmccall))
|
|
22
23
|
|
|
23
|
-
## 2.3.2
|
|
24
|
+
## 2.3.2 — 2025-07-01
|
|
24
25
|
|
|
25
26
|
### 🐛 Bug fixes
|
|
26
27
|
|
|
27
28
|
- [iOS] Use specified cache type when no transformation is applied ([#37777](https://github.com/expo/expo/pull/37777) by [@jakex7](https://github.com/jakex7))
|
|
28
29
|
|
|
29
|
-
## 2.3.1
|
|
30
|
+
## 2.3.1 — 2025-07-01
|
|
30
31
|
|
|
31
32
|
### 🐛 Bug fixes
|
|
32
33
|
|
|
@@ -36,21 +37,17 @@
|
|
|
36
37
|
|
|
37
38
|
- [Android] Bumped GIF Glide plugin to 3.0.5 for Android 16KB page size support. ([#37454](https://github.com/expo/expo/pull/37454) by [@kudo](https://github.com/kudo))
|
|
38
39
|
|
|
39
|
-
## 2.3.0
|
|
40
|
+
## 2.3.0 — 2025-06-11
|
|
40
41
|
|
|
41
42
|
### 🛠 Breaking changes
|
|
42
43
|
|
|
43
44
|
- [iOS] `useAppleWebpCodec` has been moved from the source object to the component's prop to make it usable with the local assets. ([#37300](https://github.com/expo/expo/pull/37300) by [@tsapeta](https://github.com/tsapeta))
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- [iOS] Fix blurry images when using `tintColor` by scaling `imageThumbnailPixelSize` with screen density. ([#37235](https://github.com/expo/expo/pull/37235) by [@hirbod](https://github.com/hirbod))
|
|
48
|
-
|
|
49
|
-
## 2.2.1 - 2025-06-10
|
|
46
|
+
## 2.2.1 — 2025-06-10
|
|
50
47
|
|
|
51
48
|
_This version does not introduce any user-facing changes._
|
|
52
49
|
|
|
53
|
-
## 2.2.0
|
|
50
|
+
## 2.2.0 — 2025-06-04
|
|
54
51
|
|
|
55
52
|
### 🎉 New features
|
|
56
53
|
|
|
@@ -61,7 +58,7 @@ _This version does not introduce any user-facing changes._
|
|
|
61
58
|
- Fix React Server Components support. ([#36801](https://github.com/expo/expo/pull/36801) by [@EvanBacon](https://github.com/EvanBacon))
|
|
62
59
|
- [iOS] Fix PhotoLibrary assets being scaled twice. ([#36776](https://github.com/expo/expo/pull/36776) by [@alanjhughes](https://github.com/alanjhughes))
|
|
63
60
|
- [iOS] Don't add transformers when unnecessary. ([#36884](https://github.com/expo/expo/pull/36884) by [@jakex7](https://github.com/jakex7))
|
|
64
|
-
- [
|
|
61
|
+
- [iOS] Fix blurry images when using `tintColor` by scaling `imageThumbnailPixelSize` with screen density. ([#37235](https://github.com/expo/expo/pull/37235) by [@hirbod](https://github.com/hirbod))
|
|
65
62
|
|
|
66
63
|
## 2.1.7 — 2025-05-06
|
|
67
64
|
|
package/android/build.gradle
CHANGED
|
@@ -8,7 +8,7 @@ android {
|
|
|
8
8
|
namespace "expo.modules.image"
|
|
9
9
|
defaultConfig {
|
|
10
10
|
versionCode 1
|
|
11
|
-
versionName "2.4.0
|
|
11
|
+
versionName "2.4.0"
|
|
12
12
|
consumerProguardFiles("proguard-rules.pro")
|
|
13
13
|
|
|
14
14
|
buildConfigField("boolean", "ALLOW_GLIDE_LOGS", project.properties.get("EXPO_ALLOW_GLIDE_LOGS", "false"))
|
|
@@ -5,7 +5,6 @@ package expo.modules.image
|
|
|
5
5
|
import android.graphics.Bitmap
|
|
6
6
|
import android.graphics.drawable.BitmapDrawable
|
|
7
7
|
import android.graphics.drawable.Drawable
|
|
8
|
-
import androidx.core.graphics.drawable.toBitmap
|
|
9
8
|
import androidx.core.graphics.drawable.toBitmapOrNull
|
|
10
9
|
import androidx.core.view.doOnDetach
|
|
11
10
|
import com.bumptech.glide.Glide
|
|
@@ -20,7 +19,6 @@ import com.bumptech.glide.request.target.Target
|
|
|
20
19
|
import com.github.penfeizhou.animation.apng.APNGDrawable
|
|
21
20
|
import com.github.penfeizhou.animation.gif.GifDrawable
|
|
22
21
|
import com.github.penfeizhou.animation.webp.WebPDrawable
|
|
23
|
-
import expo.modules.image.blurhash.BlurhashEncoder
|
|
24
22
|
import expo.modules.image.enums.ContentFit
|
|
25
23
|
import expo.modules.image.enums.Priority
|
|
26
24
|
import expo.modules.image.records.CachePolicy
|
|
@@ -38,12 +36,8 @@ import expo.modules.kotlin.functions.Queues
|
|
|
38
36
|
import expo.modules.kotlin.modules.Module
|
|
39
37
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
40
38
|
import expo.modules.kotlin.sharedobjects.SharedRef
|
|
41
|
-
import expo.modules.kotlin.types.Either
|
|
42
39
|
import expo.modules.kotlin.types.EitherOfThree
|
|
43
40
|
import expo.modules.kotlin.types.toKClass
|
|
44
|
-
import kotlinx.coroutines.Dispatchers
|
|
45
|
-
import kotlinx.coroutines.withContext
|
|
46
|
-
import java.net.URL
|
|
47
41
|
|
|
48
42
|
class ExpoImageModule : Module() {
|
|
49
43
|
override fun definition() = ModuleDefinition {
|
|
@@ -118,20 +112,6 @@ class ExpoImageModule : Module() {
|
|
|
118
112
|
ImageLoadTask(appContext, source, options ?: ImageLoadOptions()).load()
|
|
119
113
|
}
|
|
120
114
|
|
|
121
|
-
AsyncFunction("generateBlurhashAsync") Coroutine { source: Either<URL, Image>, numberOfComponents: Pair<Int, Int> ->
|
|
122
|
-
val image = source.let {
|
|
123
|
-
if (it.`is`(Image::class)) {
|
|
124
|
-
it.get(Image::class)
|
|
125
|
-
} else {
|
|
126
|
-
ImageLoadTask(appContext, SourceMap(uri = it.get(URL::class).toString()), ImageLoadOptions()).load()
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
val blurHash = withContext(Dispatchers.Default) {
|
|
130
|
-
BlurhashEncoder.encode(image.ref.toBitmap(), numberOfComponents)
|
|
131
|
-
}
|
|
132
|
-
blurHash
|
|
133
|
-
}
|
|
134
|
-
|
|
135
115
|
Class(Image::class) {
|
|
136
116
|
Property("width") { image: Image ->
|
|
137
117
|
image.ref.intrinsicWidth
|
|
@@ -18,7 +18,6 @@ import com.bumptech.glide.RequestManager
|
|
|
18
18
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
|
19
19
|
import com.bumptech.glide.load.resource.bitmap.DownsampleStrategy
|
|
20
20
|
import com.bumptech.glide.request.RequestOptions
|
|
21
|
-
import com.github.penfeizhou.animation.gif.GifDrawable
|
|
22
21
|
import expo.modules.image.enums.ContentFit
|
|
23
22
|
import expo.modules.image.enums.Priority
|
|
24
23
|
import expo.modules.image.events.GlideRequestListener
|
|
@@ -170,32 +169,14 @@ class ExpoImageViewWrapper(context: Context, appContext: AppContext) : ExpoView(
|
|
|
170
169
|
internal var cachePolicy: CachePolicy = CachePolicy.DISK
|
|
171
170
|
|
|
172
171
|
fun setIsAnimating(setAnimating: Boolean) {
|
|
173
|
-
|
|
174
|
-
// So we check first if the resource is a GifDrawable, because it can continue
|
|
175
|
-
// from where it was paused.
|
|
176
|
-
when (val resource = activeView.drawable) {
|
|
177
|
-
is GifDrawable -> setIsAnimating(resource, setAnimating)
|
|
178
|
-
is Animatable -> setIsAnimating(resource, setAnimating)
|
|
179
|
-
}
|
|
180
|
-
}
|
|
172
|
+
val resource = activeView.drawable
|
|
181
173
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (resource.isPaused) {
|
|
185
|
-
resource.resume()
|
|
186
|
-
} else {
|
|
174
|
+
if (resource is Animatable) {
|
|
175
|
+
if (setAnimating) {
|
|
187
176
|
resource.start()
|
|
177
|
+
} else {
|
|
178
|
+
resource.stop()
|
|
188
179
|
}
|
|
189
|
-
} else {
|
|
190
|
-
resource.pause()
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
private fun setIsAnimating(resource: Animatable, setAnimating: Boolean) {
|
|
195
|
-
if (setAnimating) {
|
|
196
|
-
resource.start()
|
|
197
|
-
} else {
|
|
198
|
-
resource.stop()
|
|
199
180
|
}
|
|
200
181
|
}
|
|
201
182
|
|
|
@@ -74,7 +74,16 @@ object BlurhashDecoder {
|
|
|
74
74
|
val r = colorEnc shr 16
|
|
75
75
|
val g = (colorEnc shr 8) and 255
|
|
76
76
|
val b = colorEnc and 255
|
|
77
|
-
return floatArrayOf(
|
|
77
|
+
return floatArrayOf(srgbToLinear(r), srgbToLinear(g), srgbToLinear(b))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private fun srgbToLinear(colorEnc: Int): Float {
|
|
81
|
+
val v = colorEnc / 255f
|
|
82
|
+
return if (v <= 0.04045f) {
|
|
83
|
+
(v / 12.92f)
|
|
84
|
+
} else {
|
|
85
|
+
((v + 0.055f) / 1.055f).pow(2.4f)
|
|
86
|
+
}
|
|
78
87
|
}
|
|
79
88
|
|
|
80
89
|
private fun decodeAc(value: Int, maxAc: Float): FloatArray {
|
|
@@ -28,7 +28,7 @@ class GlideUrlWrapperLoader(
|
|
|
28
28
|
originalResponse
|
|
29
29
|
.newBuilder()
|
|
30
30
|
.body(
|
|
31
|
-
ProgressResponseBody(
|
|
31
|
+
ProgressResponseBody(originalResponse.body) { bytesWritten, contentLength, done ->
|
|
32
32
|
model.progressListener?.onProgress(bytesWritten, contentLength, done)
|
|
33
33
|
}
|
|
34
34
|
)
|
package/build/ExpoImage.web.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ImageNativeProps } from './Image.types';
|
|
3
|
-
export default function ExpoImage({ source, placeholder, contentFit, contentPosition, placeholderContentFit, cachePolicy, onLoad, transition, onError, responsivePolicy, onLoadEnd, onDisplay, priority, blurRadius, recyclingKey, style, nativeViewRef, accessibilityLabel,
|
|
3
|
+
export default function ExpoImage({ source, placeholder, contentFit, contentPosition, placeholderContentFit, cachePolicy, onLoad, transition, onError, responsivePolicy, onLoadEnd, onDisplay, priority, blurRadius, recyclingKey, style, nativeViewRef, accessibilityLabel, tintColor, containerViewRef, ...props }: ImageNativeProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ExpoImage.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoImage.web.d.ts","sourceRoot":"","sources":["../src/ExpoImage.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAA6C,MAAM,eAAe,CAAC;AAsDjG,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,WAAW,EACX,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,MAAM,EACN,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"ExpoImage.web.d.ts","sourceRoot":"","sources":["../src/ExpoImage.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAA6C,MAAM,eAAe,CAAC;AAsDjG,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,WAAW,EACX,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,MAAM,EACN,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,gBAAgB,qBA0FlB"}
|
package/build/Image.d.ts
CHANGED
|
@@ -66,14 +66,13 @@ export declare class Image extends React.PureComponent<ImageProps> {
|
|
|
66
66
|
static getCachePathAsync(cacheKey: string): Promise<string | null>;
|
|
67
67
|
/**
|
|
68
68
|
* Asynchronously generates a [Blurhash](https://blurha.sh) from an image.
|
|
69
|
-
* @param
|
|
69
|
+
* @param url - The URL of the image to generate a blurhash from.
|
|
70
70
|
* @param numberOfComponents - The number of components to encode the blurhash with.
|
|
71
71
|
* Must be between 1 and 9. Defaults to `[4, 3]`.
|
|
72
|
-
* @platform android
|
|
73
72
|
* @platform ios
|
|
74
73
|
* @return A promise resolving to the blurhash string.
|
|
75
74
|
*/
|
|
76
|
-
static generateBlurhashAsync(
|
|
75
|
+
static generateBlurhashAsync(url: string, numberOfComponents: [number, number] | {
|
|
77
76
|
width: number;
|
|
78
77
|
height: number;
|
|
79
78
|
}): Promise<string | null>;
|
package/build/Image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,eAAe,CAAC;AAQvB,qBAAa,KAAM,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IACxD,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;gBAEnC,KAAK,EAAE,UAAU;IAO7B,gBAAgB,2BAMd;IAEF;;OAEG;IACH,MAAM,CAAC,KAAK,kBAAqB;IAEjC;;;;;;;;;;OAUG;WACU,QAAQ,CACnB,IAAI,EAAE,MAAM,GAAG,MAA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nB;;;;;;;;;;OAUG;WACU,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAoBhG;;;;;;;OAOG;WACU,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjD;;;;;;;OAOG;WACU,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/C;;;;;;;;;OASG;WACU,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIxE;;;;;;;OAOG;WACU,qBAAqB,CAChC,GAAG,EAAE,MAAM,EACX,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACvE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIzB;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;;;OAIG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxC;;;;OAIG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC;;;;;;OAMG;WACU,SAAS,CACpB,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,EACrC,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,QAAQ,CAAC;IAKpB,MAAM;CA6CP"}
|
package/build/Image.types.d.ts
CHANGED
|
@@ -140,7 +140,7 @@ export interface ImageProps extends Omit<ViewProps, 'style' | 'children'> {
|
|
|
140
140
|
blurRadius?: number;
|
|
141
141
|
/**
|
|
142
142
|
* A color used to tint template images (a bitmap image where only the opacity matters).
|
|
143
|
-
* The color is applied to every non-transparent pixel, causing the image
|
|
143
|
+
* The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color.
|
|
144
144
|
* This effect is not applied to placeholders.
|
|
145
145
|
* @default null
|
|
146
146
|
*/
|
|
@@ -264,12 +264,12 @@ export interface ImageProps extends Omit<ViewProps, 'style' | 'children'> {
|
|
|
264
264
|
*/
|
|
265
265
|
accessible?: boolean;
|
|
266
266
|
/**
|
|
267
|
-
* The text that's read by the screen reader when the user interacts with the image. Sets the `alt` tag on web which is used for web crawlers and link traversal.
|
|
267
|
+
* The text that's read by the screen reader when the user interacts with the image. Sets the the `alt` tag on web which is used for web crawlers and link traversal.
|
|
268
268
|
* @default undefined
|
|
269
269
|
*/
|
|
270
270
|
accessibilityLabel?: string;
|
|
271
271
|
/**
|
|
272
|
-
* The text that's read by the screen reader when the user interacts with the image. Sets the `alt` tag on web which is used for web crawlers and link traversal. Is an alias for `accessibilityLabel`.
|
|
272
|
+
* The text that's read by the screen reader when the user interacts with the image. Sets the the `alt` tag on web which is used for web crawlers and link traversal. Is an alias for `accessibilityLabel`.
|
|
273
273
|
*
|
|
274
274
|
* @alias accessibilityLabel
|
|
275
275
|
* @default undefined
|
|
@@ -384,14 +384,10 @@ export type ImageContentPosition =
|
|
|
384
384
|
bottom?: ImageContentPositionValue;
|
|
385
385
|
left?: ImageContentPositionValue;
|
|
386
386
|
} | ImageContentPositionString;
|
|
387
|
-
/**
|
|
388
|
-
* It allows you to use an image as a background while rendering other content on top of it.
|
|
389
|
-
* It extends all `Image` props but provides separate styling controls for the container and the background image itself.
|
|
390
|
-
*/
|
|
391
387
|
export interface ImageBackgroundProps extends Omit<ImageProps, 'style'> {
|
|
392
|
-
/** The style of the image container
|
|
388
|
+
/** The style of the image container */
|
|
393
389
|
style?: StyleProp<ViewStyle> | undefined;
|
|
394
|
-
/** Style object for the image
|
|
390
|
+
/** Style object for the image */
|
|
395
391
|
imageStyle?: StyleProp<RNImageStyle> | undefined;
|
|
396
392
|
/** @hidden */
|
|
397
393
|
children?: React.ReactNode | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.types.d.ts","sourceRoot":"","sources":["../src/Image.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAEnF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,GAA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M,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS,CAAC,OAAO,CAAC;IACtD;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY;IAEzD,KAAK,EAAE,OAAO,QAAQ,CAAC;IAEvB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAC9E;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageWrapper.d.ts","sourceRoot":"","sources":["../../src/web/ImageWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAqBzD,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ImageWrapper.d.ts","sourceRoot":"","sources":["../../src/web/ImageWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAqBzD,QAAA,MAAM,YAAY,4FA4DjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/expo-module.config.json
CHANGED
package/ios/ExpoImage.podspec
CHANGED
package/ios/ImageModule.swift
CHANGED
|
@@ -170,28 +170,19 @@ public final class ImageModule: Module {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
AsyncFunction("generateBlurhashAsync") { (
|
|
173
|
+
AsyncFunction("generateBlurhashAsync") { (url: URL, numberOfComponents: CGSize, promise: Promise) in
|
|
174
174
|
let downloader = SDWebImageDownloader()
|
|
175
|
-
let parsedNumberOfComponents = (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
} else if let url: URL = source.get() {
|
|
184
|
-
downloader.downloadImage(with: url, progress: nil, completed: { image, _, _, _ in
|
|
185
|
-
DispatchQueue.global().async {
|
|
186
|
-
if let downloadedImage = image {
|
|
187
|
-
let blurhashString = blurhash(fromImage: downloadedImage, numberOfComponents: parsedNumberOfComponents)
|
|
188
|
-
promise.resolve(blurhashString)
|
|
189
|
-
} else {
|
|
190
|
-
promise.reject(BlurhashGenerationException())
|
|
191
|
-
}
|
|
175
|
+
let parsedNumberOfComponents = (Int(numberOfComponents.width), Int(numberOfComponents.height))
|
|
176
|
+
downloader.downloadImage(with: url, progress: nil, completed: { image, _, _, _ in
|
|
177
|
+
DispatchQueue.global().async {
|
|
178
|
+
if let downloadedImage = image {
|
|
179
|
+
let blurhashString = blurhash(fromImage: downloadedImage, numberOfComponents: parsedNumberOfComponents)
|
|
180
|
+
promise.resolve(blurhashString)
|
|
181
|
+
} else {
|
|
182
|
+
promise.reject(BlurhashGenerationException())
|
|
192
183
|
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
184
|
+
}
|
|
185
|
+
})
|
|
195
186
|
}
|
|
196
187
|
|
|
197
188
|
AsyncFunction("clearMemoryCache") { () -> Bool in
|
package/ios/ImageView.swift
CHANGED
|
@@ -121,12 +121,10 @@ public final class ImageView: ExpoView {
|
|
|
121
121
|
if window == nil {
|
|
122
122
|
// Cancel pending requests when the view is unmounted.
|
|
123
123
|
cancelPendingOperation()
|
|
124
|
-
|
|
125
|
-
// Reload the image after mounting the view with non-empty bounds.
|
|
126
|
-
reload()
|
|
127
|
-
} else {
|
|
128
|
-
loadPlaceholderIfNecessary()
|
|
124
|
+
return
|
|
129
125
|
}
|
|
126
|
+
|
|
127
|
+
loadPlaceholderIfNecessary()
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
|
@@ -113,7 +113,7 @@ private func requestAsset(
|
|
|
113
113
|
if let scale = context?[ImageView.screenScaleKey] as? Double,
|
|
114
114
|
let containerSize = context?[ImageView.frameSizeKey] as? CGSize,
|
|
115
115
|
let contentFit = context?[ImageView.contentFitKey] as? ContentFit {
|
|
116
|
-
|
|
116
|
+
targetSize = idealSize(
|
|
117
117
|
contentPixelSize: CGSize(width: asset.pixelWidth, height: asset.pixelHeight),
|
|
118
118
|
containerSize: containerSize,
|
|
119
119
|
scale: scale,
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0-sources.jar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
754e5c8b8c3d801d36965a6cf0ec673a
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0-sources.jar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9d61b3b9a11effe5d06c77755eaa06d86da5d422
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d91f60ce8ec04a24413f687b5596f0165504d5b55d05c380daea5b155e537100
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4fd35480bc1edafe3727afbfb6b1d9cf69643f30523402e7512a8b2944d17915150373225d5aed1c344b80ad9c9b3fe1ff1050b2c83a13c8faa34956ddef588e
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5c50faf7e63489ecc2e5d3ab07a2f707
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
af130ea05cd1ce374351bdb409b187b699baeef7
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5d682f47a7031c3d5403faf294bb898f52299dcc73903682475cc310c39e70ac
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
47c107c9a1134bb50953e5cf037cdc5aef8088d6c1bce906d268f2cf2c6b1a2692dbbd4cf686922d9eded7a78e275fea8038b91267fffd31957fa68b297bdae8
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "BareExpo",
|
|
5
5
|
"module": "expo.modules.image",
|
|
6
|
-
"version": "2.4.0
|
|
6
|
+
"version": "2.4.0",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"createdBy": {
|
|
12
12
|
"gradle": {
|
|
13
|
-
"version": "8.
|
|
13
|
+
"version": "8.13"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"variants": [
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
],
|
|
55
55
|
"files": [
|
|
56
56
|
{
|
|
57
|
-
"name": "expo.modules.image-2.4.0
|
|
58
|
-
"url": "expo.modules.image-2.4.0
|
|
59
|
-
"size":
|
|
60
|
-
"sha512": "
|
|
61
|
-
"sha256": "
|
|
62
|
-
"sha1": "
|
|
63
|
-
"md5": "
|
|
57
|
+
"name": "expo.modules.image-2.4.0.aar",
|
|
58
|
+
"url": "expo.modules.image-2.4.0.aar",
|
|
59
|
+
"size": 279544,
|
|
60
|
+
"sha512": "47c107c9a1134bb50953e5cf037cdc5aef8088d6c1bce906d268f2cf2c6b1a2692dbbd4cf686922d9eded7a78e275fea8038b91267fffd31957fa68b297bdae8",
|
|
61
|
+
"sha256": "5d682f47a7031c3d5403faf294bb898f52299dcc73903682475cc310c39e70ac",
|
|
62
|
+
"sha1": "af130ea05cd1ce374351bdb409b187b699baeef7",
|
|
63
|
+
"md5": "5c50faf7e63489ecc2e5d3ab07a2f707"
|
|
64
64
|
}
|
|
65
65
|
]
|
|
66
66
|
},
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"group": "org.jetbrains.kotlin",
|
|
78
78
|
"module": "kotlin-stdlib-jdk7",
|
|
79
79
|
"version": {
|
|
80
|
-
"requires": "2.
|
|
80
|
+
"requires": "2.0.21"
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
{
|
|
@@ -143,13 +143,13 @@
|
|
|
143
143
|
],
|
|
144
144
|
"files": [
|
|
145
145
|
{
|
|
146
|
-
"name": "expo.modules.image-2.4.0
|
|
147
|
-
"url": "expo.modules.image-2.4.0
|
|
148
|
-
"size":
|
|
149
|
-
"sha512": "
|
|
150
|
-
"sha256": "
|
|
151
|
-
"sha1": "
|
|
152
|
-
"md5": "
|
|
146
|
+
"name": "expo.modules.image-2.4.0.aar",
|
|
147
|
+
"url": "expo.modules.image-2.4.0.aar",
|
|
148
|
+
"size": 279544,
|
|
149
|
+
"sha512": "47c107c9a1134bb50953e5cf037cdc5aef8088d6c1bce906d268f2cf2c6b1a2692dbbd4cf686922d9eded7a78e275fea8038b91267fffd31957fa68b297bdae8",
|
|
150
|
+
"sha256": "5d682f47a7031c3d5403faf294bb898f52299dcc73903682475cc310c39e70ac",
|
|
151
|
+
"sha1": "af130ea05cd1ce374351bdb409b187b699baeef7",
|
|
152
|
+
"md5": "5c50faf7e63489ecc2e5d3ab07a2f707"
|
|
153
153
|
}
|
|
154
154
|
]
|
|
155
155
|
},
|
|
@@ -163,13 +163,13 @@
|
|
|
163
163
|
},
|
|
164
164
|
"files": [
|
|
165
165
|
{
|
|
166
|
-
"name": "expo.modules.image-2.4.0-
|
|
167
|
-
"url": "expo.modules.image-2.4.0-
|
|
168
|
-
"size":
|
|
169
|
-
"sha512": "
|
|
170
|
-
"sha256": "
|
|
171
|
-
"sha1": "
|
|
172
|
-
"md5": "
|
|
166
|
+
"name": "expo.modules.image-2.4.0-sources.jar",
|
|
167
|
+
"url": "expo.modules.image-2.4.0-sources.jar",
|
|
168
|
+
"size": 64200,
|
|
169
|
+
"sha512": "4fd35480bc1edafe3727afbfb6b1d9cf69643f30523402e7512a8b2944d17915150373225d5aed1c344b80ad9c9b3fe1ff1050b2c83a13c8faa34956ddef588e",
|
|
170
|
+
"sha256": "d91f60ce8ec04a24413f687b5596f0165504d5b55d05c380daea5b155e537100",
|
|
171
|
+
"sha1": "9d61b3b9a11effe5d06c77755eaa06d86da5d422",
|
|
172
|
+
"md5": "754e5c8b8c3d801d36965a6cf0ec673a"
|
|
173
173
|
}
|
|
174
174
|
]
|
|
175
175
|
}
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c4e48b180872f7a629833093d37dd421
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2238e62eef736e0e1de54d5e036a57a8cc3d79ae
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
23939cac468cccca953ace26a1fad6083895a2689bb1ad23a78135a7483bb53b
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.module.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e7cb288d652efc29af86d11f19cb55e73000f90e496154c05b41a9a325f54e82a624048b45ca7ed70d817aec41e8d60600dcb72291be98fe7701665b91047831
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>BareExpo</groupId>
|
|
11
11
|
<artifactId>expo.modules.image</artifactId>
|
|
12
|
-
<version>2.4.0
|
|
12
|
+
<version>2.4.0</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.image</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<dependency>
|
|
53
53
|
<groupId>org.jetbrains.kotlin</groupId>
|
|
54
54
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
|
55
|
-
<version>2.
|
|
55
|
+
<version>2.0.21</version>
|
|
56
56
|
<scope>runtime</scope>
|
|
57
57
|
</dependency>
|
|
58
58
|
<dependency>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
72f97967d87cede87c3d7d01588838ae
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7fd32bce5a9f82f5f782137fa52deaf08fef0cde
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3466f845bfa2c6eac83ced501b0b19e1ab7cb2662fcf25dafeeb9ef97e630c67
|
package/local-maven-repo/BareExpo/expo.modules.image/2.4.0/expo.modules.image-2.4.0.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6f0541af9487a6e5d47165b01b320d5c09fba54eb30f5d8c42f225398a6c0c2c46966b9ca8b18cca0506e8603671abf0924febf40bb9c60cd0d4948d92663a5c
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>BareExpo</groupId>
|
|
4
4
|
<artifactId>expo.modules.image</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>2.4.0
|
|
7
|
-
<release>2.4.0
|
|
6
|
+
<latest>2.4.0</latest>
|
|
7
|
+
<release>2.4.0</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>2.4.0
|
|
9
|
+
<version>2.4.0</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250717085701</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
bb9fa66dc61a5b1c39306038d9b977e6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1278c60532c365638d1e42c340517045706c7daf
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
11c3fa4dfccbb903934b20f0e1ebc8789f27741c578bb033b8aac084ab05f2b2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2925015325e8eb16b660ff4f60124272d77c66c073e80fa3f6ee0c6a0d5eed8f2da3f7a7541a3e18e85c5c63d0add0f164af56463508d2f16cfcd87973497587
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-image",
|
|
3
3
|
"title": "Expo Image",
|
|
4
|
-
"version": "2.4.0
|
|
4
|
+
"version": "2.4.0",
|
|
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",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"expo-module-scripts": "4.1.
|
|
32
|
+
"expo-module-scripts": "^4.1.9"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"expo": "
|
|
35
|
+
"expo": "*",
|
|
36
36
|
"react": "*",
|
|
37
37
|
"react-native": "*",
|
|
38
38
|
"react-native-web": "*"
|
|
@@ -44,5 +44,6 @@
|
|
|
44
44
|
},
|
|
45
45
|
"jest": {
|
|
46
46
|
"preset": "expo-module-scripts"
|
|
47
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"gitHead": "b69736d615d303c2143e7682b37c93665e1ed3d9"
|
|
48
49
|
}
|
package/src/ExpoImage.web.tsx
CHANGED
|
@@ -75,7 +75,6 @@ export default function ExpoImage({
|
|
|
75
75
|
style,
|
|
76
76
|
nativeViewRef,
|
|
77
77
|
accessibilityLabel,
|
|
78
|
-
alt,
|
|
79
78
|
tintColor,
|
|
80
79
|
containerViewRef,
|
|
81
80
|
...props
|
|
@@ -115,7 +114,7 @@ export default function ExpoImage({
|
|
|
115
114
|
contentPosition={{ left: '50%', top: '50%' }}
|
|
116
115
|
hashPlaceholderContentPosition={contentPosition}
|
|
117
116
|
hashPlaceholderStyle={imageHashStyle}
|
|
118
|
-
accessibilityLabel={accessibilityLabel
|
|
117
|
+
accessibilityLabel={accessibilityLabel}
|
|
119
118
|
cachePolicy={cachePolicy}
|
|
120
119
|
priority={priority}
|
|
121
120
|
tintColor={tintColor}
|
package/src/Image.tsx
CHANGED
|
@@ -129,18 +129,17 @@ export class Image extends React.PureComponent<ImageProps> {
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* Asynchronously generates a [Blurhash](https://blurha.sh) from an image.
|
|
132
|
-
* @param
|
|
132
|
+
* @param url - The URL of the image to generate a blurhash from.
|
|
133
133
|
* @param numberOfComponents - The number of components to encode the blurhash with.
|
|
134
134
|
* Must be between 1 and 9. Defaults to `[4, 3]`.
|
|
135
|
-
* @platform android
|
|
136
135
|
* @platform ios
|
|
137
136
|
* @return A promise resolving to the blurhash string.
|
|
138
137
|
*/
|
|
139
138
|
static async generateBlurhashAsync(
|
|
140
|
-
|
|
139
|
+
url: string,
|
|
141
140
|
numberOfComponents: [number, number] | { width: number; height: number }
|
|
142
141
|
): Promise<string | null> {
|
|
143
|
-
return ImageModule.generateBlurhashAsync(
|
|
142
|
+
return await ImageModule.generateBlurhashAsync(url, numberOfComponents);
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
/**
|
package/src/Image.types.ts
CHANGED
|
@@ -164,7 +164,7 @@ export interface ImageProps extends Omit<ViewProps, 'style' | 'children'> {
|
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* A color used to tint template images (a bitmap image where only the opacity matters).
|
|
167
|
-
* The color is applied to every non-transparent pixel, causing the image
|
|
167
|
+
* The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color.
|
|
168
168
|
* This effect is not applied to placeholders.
|
|
169
169
|
* @default null
|
|
170
170
|
*/
|
|
@@ -308,13 +308,13 @@ export interface ImageProps extends Omit<ViewProps, 'style' | 'children'> {
|
|
|
308
308
|
accessible?: boolean;
|
|
309
309
|
|
|
310
310
|
/**
|
|
311
|
-
* The text that's read by the screen reader when the user interacts with the image. Sets the `alt` tag on web which is used for web crawlers and link traversal.
|
|
311
|
+
* The text that's read by the screen reader when the user interacts with the image. Sets the the `alt` tag on web which is used for web crawlers and link traversal.
|
|
312
312
|
* @default undefined
|
|
313
313
|
*/
|
|
314
314
|
accessibilityLabel?: string;
|
|
315
315
|
|
|
316
316
|
/**
|
|
317
|
-
* The text that's read by the screen reader when the user interacts with the image. Sets the `alt` tag on web which is used for web crawlers and link traversal. Is an alias for `accessibilityLabel`.
|
|
317
|
+
* The text that's read by the screen reader when the user interacts with the image. Sets the the `alt` tag on web which is used for web crawlers and link traversal. Is an alias for `accessibilityLabel`.
|
|
318
318
|
*
|
|
319
319
|
* @alias accessibilityLabel
|
|
320
320
|
* @default undefined
|
|
@@ -439,14 +439,10 @@ export type ImageContentPosition =
|
|
|
439
439
|
}
|
|
440
440
|
| ImageContentPositionString;
|
|
441
441
|
|
|
442
|
-
/**
|
|
443
|
-
* It allows you to use an image as a background while rendering other content on top of it.
|
|
444
|
-
* It extends all `Image` props but provides separate styling controls for the container and the background image itself.
|
|
445
|
-
*/
|
|
446
442
|
export interface ImageBackgroundProps extends Omit<ImageProps, 'style'> {
|
|
447
|
-
/** The style of the image container
|
|
443
|
+
/** The style of the image container */
|
|
448
444
|
style?: StyleProp<ViewStyle> | undefined;
|
|
449
|
-
/** Style object for the image
|
|
445
|
+
/** Style object for the image */
|
|
450
446
|
imageStyle?: StyleProp<RNImageStyle> | undefined;
|
|
451
447
|
/** @hidden */
|
|
452
448
|
children?: React.ReactNode | undefined;
|
package/src/web/ImageWrapper.tsx
CHANGED
|
@@ -44,14 +44,7 @@ const ImageWrapper = React.forwardRef(
|
|
|
44
44
|
events?.onMount?.forEach((e) => e?.());
|
|
45
45
|
}, []);
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
// on the same page with different tint colors without conflicts.
|
|
49
|
-
const tintId = useId()
|
|
50
|
-
// Make it safe for use as an SVG ID. SVG IDs are most strict than HTML
|
|
51
|
-
// IDs. They must be compliant with https://www.w3.org/TR/xml/#NT-Name.
|
|
52
|
-
// React 19 changed useId() to include « and ». These must be removed or
|
|
53
|
-
// the SVG filter will not work (e.g. in Safari which enforces the spec).
|
|
54
|
-
.replace(/[«»]/g, '_');
|
|
47
|
+
const tintId = useId();
|
|
55
48
|
|
|
56
49
|
// Thumbhash uri always has to start with 'thumbhash:/'
|
|
57
50
|
const { resolvedSource, isImageHash } = useImageHashes(source);
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
package expo.modules.image.blurhash
|
|
2
|
-
|
|
3
|
-
import android.graphics.Bitmap
|
|
4
|
-
import android.graphics.Color
|
|
5
|
-
import kotlin.math.*
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Rewritten in kotlin from https://github.com/woltapp/blurhash/blob/master/Swift/BlurHashEncode.swift
|
|
9
|
-
*/
|
|
10
|
-
object BlurhashEncoder {
|
|
11
|
-
fun encode(image: Bitmap, numberOfComponents: Pair<Int, Int>): String {
|
|
12
|
-
val pixels = IntArray(image.width * image.height)
|
|
13
|
-
image.getPixels(pixels, 0, image.width, 0, 0, image.width, image.height)
|
|
14
|
-
|
|
15
|
-
val factors = calculateBlurFactors(pixels, image.width, image.height, numberOfComponents)
|
|
16
|
-
|
|
17
|
-
val dc = factors.first()
|
|
18
|
-
val ac = factors.drop(1)
|
|
19
|
-
val hashBuilder = StringBuilder()
|
|
20
|
-
|
|
21
|
-
encodeFlag(numberOfComponents, hashBuilder)
|
|
22
|
-
val maximumValue = encodeMaximumValue(ac, hashBuilder)
|
|
23
|
-
hashBuilder.append(encode83(encodeDC(dc), 4))
|
|
24
|
-
for (factor in ac) {
|
|
25
|
-
hashBuilder.append(encode83(encodeAC(factor, maximumValue), 2))
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return hashBuilder.toString()
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
private fun encodeFlag(numberOfComponents: Pair<Int, Int>, hashBuilder: StringBuilder) {
|
|
32
|
-
val sizeFlag = (numberOfComponents.first - 1) + (numberOfComponents.second - 1) * 9
|
|
33
|
-
hashBuilder.append(encode83(sizeFlag, 1))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
private fun encodeMaximumValue(ac: List<Triple<Float, Float, Float>>, hash: StringBuilder): Float {
|
|
37
|
-
val maximumValue: Float
|
|
38
|
-
if (ac.isNotEmpty()) {
|
|
39
|
-
val actualMaximumValue = ac.maxOf { t -> max(max(abs(t.first), abs(t.second)), abs(t.third)) }
|
|
40
|
-
val quantisedMaximumValue = max(0f, min(82f, floor(actualMaximumValue * 166f - 0.5f))).toInt()
|
|
41
|
-
maximumValue = (quantisedMaximumValue + 1).toFloat() / 166f
|
|
42
|
-
hash.append(encode83(quantisedMaximumValue, 1))
|
|
43
|
-
} else {
|
|
44
|
-
maximumValue = 1f
|
|
45
|
-
hash.append(encode83(0, 1))
|
|
46
|
-
}
|
|
47
|
-
return maximumValue
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private fun calculateBlurFactors(pixels: IntArray, width: Int, height: Int, numberOfComponents: Pair<Int, Int>): List<Triple<Float, Float, Float>> {
|
|
51
|
-
val factors = mutableListOf<Triple<Float, Float, Float>>()
|
|
52
|
-
for (y in 0 until numberOfComponents.second) {
|
|
53
|
-
for (x in 0 until numberOfComponents.first) {
|
|
54
|
-
val normalisation = if (x == 0 && y == 0) 1f else 2f
|
|
55
|
-
val factor = multiplyBasisFunction(pixels, width, height, x, y, normalisation)
|
|
56
|
-
factors.add(factor)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return factors
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
private fun encode83(value: Int, length: Int): String {
|
|
63
|
-
var result = ""
|
|
64
|
-
for (i in 1..length) {
|
|
65
|
-
val digit = (value / 83f.pow((length - i).toFloat())) % 83f
|
|
66
|
-
result += ENCODE_CHARACTERS[digit.toInt()]
|
|
67
|
-
}
|
|
68
|
-
return result
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
private const val ENCODE_CHARACTERS =
|
|
72
|
-
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~"
|
|
73
|
-
|
|
74
|
-
private fun encodeDC(value: Triple<Float, Float, Float>): Int {
|
|
75
|
-
val roundedR = BlurhashHelpers.linearTosRGB(value.first)
|
|
76
|
-
val roundedG = BlurhashHelpers.linearTosRGB(value.second)
|
|
77
|
-
val roundedB = BlurhashHelpers.linearTosRGB(value.third)
|
|
78
|
-
return (roundedR shl 16) + (roundedG shl 8) + roundedB
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
private fun encodeAC(value: Triple<Float, Float, Float>, maximumValue: Float): Int {
|
|
82
|
-
val quantR = max(0f, min(18f, floor(BlurhashHelpers.signPow(value.first / maximumValue, 0.5f) * 9f + 9.5f)))
|
|
83
|
-
val quantG = max(0f, min(18f, floor(BlurhashHelpers.signPow(value.second / maximumValue, 0.5f) * 9f + 9.5f)))
|
|
84
|
-
val quantB = max(0f, min(18f, floor(BlurhashHelpers.signPow(value.third / maximumValue, 0.5f) * 9f + 9.5f)))
|
|
85
|
-
|
|
86
|
-
return (quantR * 19f * 19f + quantG * 19f + quantB).toInt()
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
private fun multiplyBasisFunction(pixels: IntArray, width: Int, height: Int, x: Int, y: Int, normalisation: Float): Triple<Float, Float, Float> {
|
|
90
|
-
var r = 0f
|
|
91
|
-
var g = 0f
|
|
92
|
-
var b = 0f
|
|
93
|
-
|
|
94
|
-
for (j in 0 until height) {
|
|
95
|
-
for (i in 0 until width) {
|
|
96
|
-
val basis = normalisation * cos(PI.toFloat() * x * i / width) * cos(PI.toFloat() * y * j / height)
|
|
97
|
-
|
|
98
|
-
val pixel = pixels[i + j * width]
|
|
99
|
-
val pr = BlurhashHelpers.srgbToLinear(Color.red(pixel))
|
|
100
|
-
val pg = BlurhashHelpers.srgbToLinear(Color.green(pixel))
|
|
101
|
-
val pb = BlurhashHelpers.srgbToLinear(Color.blue(pixel))
|
|
102
|
-
|
|
103
|
-
r += basis * pr
|
|
104
|
-
g += basis * pg
|
|
105
|
-
b += basis * pb
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
val scale = 1f / (width * height)
|
|
110
|
-
return Triple(r * scale, g * scale, b * scale)
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
package expo.modules.image.blurhash
|
|
2
|
-
|
|
3
|
-
import android.graphics.Bitmap
|
|
4
|
-
import kotlin.math.*
|
|
5
|
-
|
|
6
|
-
object BlurhashHelpers {
|
|
7
|
-
fun srgbToLinear(colorEnc: Int): Float {
|
|
8
|
-
val v = colorEnc / 255f
|
|
9
|
-
return if (v <= 0.04045f) {
|
|
10
|
-
(v / 12.92f)
|
|
11
|
-
} else {
|
|
12
|
-
((v + 0.055f) / 1.055f).pow(2.4f)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
fun linearTosRGB(value: Float): Int {
|
|
17
|
-
val v = max(0f, min(1f, value))
|
|
18
|
-
return if (v <= 0.0031308) {
|
|
19
|
-
(v * 12.92 * 255 + 0.5).toInt()
|
|
20
|
-
} else {
|
|
21
|
-
(1.055 * (v.pow(1f / 2.4f) - 0.055) * 255 + 0.5).toInt()
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
fun signPow(value: Float, exp: Float): Float {
|
|
26
|
-
return abs(value).pow(exp) * sign(value)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
fun getBitsPerPixel(bitmap: Bitmap): Int {
|
|
30
|
-
return when (bitmap.config) {
|
|
31
|
-
Bitmap.Config.ARGB_8888 -> 32
|
|
32
|
-
Bitmap.Config.RGB_565 -> 16
|
|
33
|
-
Bitmap.Config.ALPHA_8 -> 8
|
|
34
|
-
Bitmap.Config.ARGB_4444 -> 16
|
|
35
|
-
else -> 0
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fb1a021a3c959caf9c844732221afe77
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f59c1a61e799d72cf2da93e51bdb6bfc76a1fecb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
047cf4256d9f1f9d37b874fe403d46abd838a59bbdf3d5b923d25b546242d99f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5088775ebe8dbdd3636ae44627d45f466d3b26af289ccd64cc7f59a1db50045ec4c246dfacdfa80fdedd21b09f837215dd2f0843c8915c10afe74400ec3e626c
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
987b16fc46ba4dfb8d53af2daf99fc7a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d892986ab6d024ecfd622bf341abc5e0852b67e6
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
28459572fbb29787a5b5eaab8cbec8d65ebcb8b1bff80d4b41020b76188714dc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5928b97432f974641d14f99976ddd03c1933731a6dc215222f3635e8fd3a93fc807eb2068ac61b5618ade31e881c73cba403dec7737c0ad5ea15b23e146c9b87
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ab8018d2c5d5ffa5bd5955ea673d4c35
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a2795a35433c43379b7d7ce4215c798d3b09cc42
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
15e74935002f0cfa1b14a35221699ae70a98f4e2a04dfc6308170c86fd2fb432
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0c24d72091a2260318e8f0634b73a786a68edcc3efa686ed3a9756740e2cf897073c54071530268629ab1f28eb461941a36303ed0ba4db5f6df5fba0cbf82fec
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ebe2292114020700c6ef19086cf988c4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1e208717d87a1ba95f2a0f47e129733b80893de8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
19e4200b968e5ea875ddfc5e6052016998164c079fe546219ac4c1694c32dad5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fbbb81d82cacda91b017192e2a95b7d6aae669ec1e6609d211d7ac571a74556e58e81ae5e626ea2ced1ce982dc42d9e76c797135572bcb06d282ef3e3e628a0b
|