@amazon-devices/expo-image 2.0.1758683737

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.
Files changed (289) hide show
  1. package/.eslintrc.js +2 -0
  2. package/CHANGELOG.md +285 -0
  3. package/CMakeLists.txt +91 -0
  4. package/LICENSE +7 -0
  5. package/README.kepler.md +123 -0
  6. package/README.md +54 -0
  7. package/THIRD_PARTY_NOTICES.txt +24 -0
  8. package/android/build.gradle +124 -0
  9. package/android/proguard-rules.pro +28 -0
  10. package/android/src/main/AndroidManifest.xml +15 -0
  11. package/android/src/main/java/expo/modules/image/Exceptions.kt +9 -0
  12. package/android/src/main/java/expo/modules/image/ExpoImageAppGlideModule.kt +19 -0
  13. package/android/src/main/java/expo/modules/image/ExpoImageModule.kt +192 -0
  14. package/android/src/main/java/expo/modules/image/ExpoImageView.kt +220 -0
  15. package/android/src/main/java/expo/modules/image/ExpoImageViewWrapper.kt +652 -0
  16. package/android/src/main/java/expo/modules/image/GlideModel.kt +73 -0
  17. package/android/src/main/java/expo/modules/image/ImageUtils.kt +50 -0
  18. package/android/src/main/java/expo/modules/image/ImageViewWrapperTarget.kt +313 -0
  19. package/android/src/main/java/expo/modules/image/ResourceIdHelper.kt +47 -0
  20. package/android/src/main/java/expo/modules/image/ThumbnailRequestCoordinatorExtension.kt +21 -0
  21. package/android/src/main/java/expo/modules/image/YogaUtils.kt +20 -0
  22. package/android/src/main/java/expo/modules/image/blurhash/BlurHashFetcher.kt +32 -0
  23. package/android/src/main/java/expo/modules/image/blurhash/BlurhashDecoder.kt +189 -0
  24. package/android/src/main/java/expo/modules/image/blurhash/BlurhashModelLoader.kt +30 -0
  25. package/android/src/main/java/expo/modules/image/blurhash/BlurhashModelLoaderFactory.kt +14 -0
  26. package/android/src/main/java/expo/modules/image/blurhash/BlurhashModule.kt +17 -0
  27. package/android/src/main/java/expo/modules/image/dataurls/Base64DataFetcher.kt +27 -0
  28. package/android/src/main/java/expo/modules/image/dataurls/Base64ModelLoader.kt +24 -0
  29. package/android/src/main/java/expo/modules/image/dataurls/Base64ModelLoaderFactory.kt +12 -0
  30. package/android/src/main/java/expo/modules/image/dataurls/Base64Module.kt +16 -0
  31. package/android/src/main/java/expo/modules/image/drawing/OutlineProvider.kt +201 -0
  32. package/android/src/main/java/expo/modules/image/enums/ContentFit.kt +89 -0
  33. package/android/src/main/java/expo/modules/image/enums/ImageCacheType.kt +14 -0
  34. package/android/src/main/java/expo/modules/image/enums/Priority.kt +15 -0
  35. package/android/src/main/java/expo/modules/image/events/GlideRequestListener.kt +64 -0
  36. package/android/src/main/java/expo/modules/image/events/OkHttpProgressListener.kt +26 -0
  37. package/android/src/main/java/expo/modules/image/okhttp/ExpoImageOkHttpClientGlideModule.kt +80 -0
  38. package/android/src/main/java/expo/modules/image/okhttp/GlideUrlWrapperLoader.kt +55 -0
  39. package/android/src/main/java/expo/modules/image/records/CachePolicy.kt +10 -0
  40. package/android/src/main/java/expo/modules/image/records/ContentPosition.kt +89 -0
  41. package/android/src/main/java/expo/modules/image/records/ImageTransition.kt +8 -0
  42. package/android/src/main/java/expo/modules/image/records/SourceMap.kt +160 -0
  43. package/android/src/main/java/expo/modules/image/records/events.kt +25 -0
  44. package/android/src/main/java/expo/modules/image/svg/SVGDecoder.kt +33 -0
  45. package/android/src/main/java/expo/modules/image/svg/SVGDrawableTranscoder.kt +37 -0
  46. package/android/src/main/java/expo/modules/image/svg/SVGModule.kt +26 -0
  47. package/android/src/main/java/expo/modules/image/thumbhash/ThumbhashDecoder.kt +365 -0
  48. package/android/src/main/java/expo/modules/image/thumbhash/ThumbhashFetcher.kt +31 -0
  49. package/android/src/main/java/expo/modules/image/thumbhash/ThumbhashModelLoader.kt +26 -0
  50. package/android/src/main/java/expo/modules/image/thumbhash/ThumbhashModelLoaderFactory.kt +14 -0
  51. package/android/src/main/java/expo/modules/image/thumbhash/ThumbhashModule.kt +17 -0
  52. package/build/ExpoImage.d.ts +15 -0
  53. package/build/ExpoImage.d.ts.map +1 -0
  54. package/build/ExpoImage.js +75 -0
  55. package/build/ExpoImage.js.map +1 -0
  56. package/build/ExpoImage.kepler.d.ts +23 -0
  57. package/build/ExpoImage.kepler.d.ts.map +1 -0
  58. package/build/ExpoImage.kepler.js +71 -0
  59. package/build/ExpoImage.kepler.js.map +1 -0
  60. package/build/ExpoImage.web.d.ts +9 -0
  61. package/build/ExpoImage.web.d.ts.map +1 -0
  62. package/build/ExpoImage.web.js +90 -0
  63. package/build/ExpoImage.web.js.map +1 -0
  64. package/build/ExpoImageModules.d.ts +3 -0
  65. package/build/ExpoImageModules.d.ts.map +1 -0
  66. package/build/ExpoImageModules.js +4 -0
  67. package/build/ExpoImageModules.js.map +1 -0
  68. package/build/ExpoImageModules.kepler.d.ts +6 -0
  69. package/build/ExpoImageModules.kepler.d.ts.map +1 -0
  70. package/build/ExpoImageModules.kepler.js +5 -0
  71. package/build/ExpoImageModules.kepler.js.map +1 -0
  72. package/build/Image.d.ts +30 -0
  73. package/build/Image.d.ts.map +1 -0
  74. package/build/Image.js +49 -0
  75. package/build/Image.js.map +1 -0
  76. package/build/Image.types.d.ts +374 -0
  77. package/build/Image.types.d.ts.map +1 -0
  78. package/build/Image.types.js +2 -0
  79. package/build/Image.types.js.map +1 -0
  80. package/build/ImageBackground.d.ts +6 -0
  81. package/build/ImageBackground.d.ts.map +1 -0
  82. package/build/ImageBackground.js +13 -0
  83. package/build/ImageBackground.js.map +1 -0
  84. package/build/ImageViewNativeComponent.d.ts +20 -0
  85. package/build/ImageViewNativeComponent.d.ts.map +1 -0
  86. package/build/ImageViewNativeComponent.js +42 -0
  87. package/build/ImageViewNativeComponent.js.map +1 -0
  88. package/build/NativeImageLoaderKepler.d.ts +18 -0
  89. package/build/NativeImageLoaderKepler.d.ts.map +1 -0
  90. package/build/NativeImageLoaderKepler.js +3 -0
  91. package/build/NativeImageLoaderKepler.js.map +1 -0
  92. package/build/fabric/registerNativeComponent.d.ts +15 -0
  93. package/build/fabric/registerNativeComponent.d.ts.map +1 -0
  94. package/build/fabric/registerNativeComponent.js +47 -0
  95. package/build/fabric/registerNativeComponent.js.map +1 -0
  96. package/build/index.d.ts +4 -0
  97. package/build/index.d.ts.map +1 -0
  98. package/build/index.js +4 -0
  99. package/build/index.js.map +1 -0
  100. package/build/utils/AssetSourceResolver.web.d.ts +24 -0
  101. package/build/utils/AssetSourceResolver.web.d.ts.map +1 -0
  102. package/build/utils/AssetSourceResolver.web.js +67 -0
  103. package/build/utils/AssetSourceResolver.web.js.map +1 -0
  104. package/build/utils/blurhash/base83.d.ts +3 -0
  105. package/build/utils/blurhash/base83.d.ts.map +1 -0
  106. package/build/utils/blurhash/base83.js +103 -0
  107. package/build/utils/blurhash/base83.js.map +1 -0
  108. package/build/utils/blurhash/decode.d.ts +7 -0
  109. package/build/utils/blurhash/decode.d.ts.map +1 -0
  110. package/build/utils/blurhash/decode.js +92 -0
  111. package/build/utils/blurhash/decode.js.map +1 -0
  112. package/build/utils/blurhash/error.d.ts +4 -0
  113. package/build/utils/blurhash/error.d.ts.map +1 -0
  114. package/build/utils/blurhash/error.js +8 -0
  115. package/build/utils/blurhash/error.js.map +1 -0
  116. package/build/utils/blurhash/useBlurhash.d.ts +8 -0
  117. package/build/utils/blurhash/useBlurhash.d.ts.map +1 -0
  118. package/build/utils/blurhash/useBlurhash.js +64 -0
  119. package/build/utils/blurhash/useBlurhash.js.map +1 -0
  120. package/build/utils/blurhash/utils.d.ts +5 -0
  121. package/build/utils/blurhash/utils.d.ts.map +1 -0
  122. package/build/utils/blurhash/utils.js +21 -0
  123. package/build/utils/blurhash/utils.js.map +1 -0
  124. package/build/utils/resolveAssetSource.d.ts +3 -0
  125. package/build/utils/resolveAssetSource.d.ts.map +1 -0
  126. package/build/utils/resolveAssetSource.js +3 -0
  127. package/build/utils/resolveAssetSource.js.map +1 -0
  128. package/build/utils/resolveAssetSource.web.d.ts +9 -0
  129. package/build/utils/resolveAssetSource.web.d.ts.map +1 -0
  130. package/build/utils/resolveAssetSource.web.js +31 -0
  131. package/build/utils/resolveAssetSource.web.js.map +1 -0
  132. package/build/utils/resolveHashString.d.ts +14 -0
  133. package/build/utils/resolveHashString.d.ts.map +1 -0
  134. package/build/utils/resolveHashString.js +31 -0
  135. package/build/utils/resolveHashString.js.map +1 -0
  136. package/build/utils/resolveHashString.web.d.ts +20 -0
  137. package/build/utils/resolveHashString.web.d.ts.map +1 -0
  138. package/build/utils/resolveHashString.web.js +31 -0
  139. package/build/utils/resolveHashString.web.js.map +1 -0
  140. package/build/utils/resolveSources.d.ts +8 -0
  141. package/build/utils/resolveSources.d.ts.map +1 -0
  142. package/build/utils/resolveSources.js +45 -0
  143. package/build/utils/resolveSources.js.map +1 -0
  144. package/build/utils/thumbhash/thumbhash.d.ts +66 -0
  145. package/build/utils/thumbhash/thumbhash.d.ts.map +1 -0
  146. package/build/utils/thumbhash/thumbhash.js +338 -0
  147. package/build/utils/thumbhash/thumbhash.js.map +1 -0
  148. package/build/utils.d.ts +17 -0
  149. package/build/utils.d.ts.map +1 -0
  150. package/build/utils.js +85 -0
  151. package/build/utils.js.map +1 -0
  152. package/build/web/AnimationManager.d.ts +37 -0
  153. package/build/web/AnimationManager.d.ts.map +1 -0
  154. package/build/web/AnimationManager.js +155 -0
  155. package/build/web/AnimationManager.js.map +1 -0
  156. package/build/web/ColorTintFilter.d.ts +12 -0
  157. package/build/web/ColorTintFilter.d.ts.map +1 -0
  158. package/build/web/ColorTintFilter.js +30 -0
  159. package/build/web/ColorTintFilter.js.map +1 -0
  160. package/build/web/ImageWrapper.d.ts +5 -0
  161. package/build/web/ImageWrapper.d.ts.map +1 -0
  162. package/build/web/ImageWrapper.js +44 -0
  163. package/build/web/ImageWrapper.js.map +1 -0
  164. package/build/web/ImageWrapper.types.d.ts +29 -0
  165. package/build/web/ImageWrapper.types.d.ts.map +1 -0
  166. package/build/web/ImageWrapper.types.js +2 -0
  167. package/build/web/ImageWrapper.types.js.map +1 -0
  168. package/build/web/getImageWrapperEventHandler.d.ts +8 -0
  169. package/build/web/getImageWrapperEventHandler.d.ts.map +1 -0
  170. package/build/web/getImageWrapperEventHandler.js +25 -0
  171. package/build/web/getImageWrapperEventHandler.js.map +1 -0
  172. package/build/web/hooks.d.ts +13 -0
  173. package/build/web/hooks.d.ts.map +1 -0
  174. package/build/web/hooks.js +58 -0
  175. package/build/web/hooks.js.map +1 -0
  176. package/build/web/imageStyles.d.ts +2 -0
  177. package/build/web/imageStyles.d.ts.map +1 -0
  178. package/build/web/imageStyles.js +137 -0
  179. package/build/web/imageStyles.js.map +1 -0
  180. package/build/web/positioning.d.ts +11 -0
  181. package/build/web/positioning.d.ts.map +1 -0
  182. package/build/web/positioning.js +35 -0
  183. package/build/web/positioning.js.map +1 -0
  184. package/build/web/useSourceSelection.d.ts +14 -0
  185. package/build/web/useSourceSelection.d.ts.map +1 -0
  186. package/build/web/useSourceSelection.js +98 -0
  187. package/build/web/useSourceSelection.js.map +1 -0
  188. package/expo-module.config.json +9 -0
  189. package/ios/Blurhash.swift +326 -0
  190. package/ios/BlurhashLoader.swift +52 -0
  191. package/ios/ContentFit.swift +55 -0
  192. package/ios/ContentPosition.swift +108 -0
  193. package/ios/ExpoImage.podspec +30 -0
  194. package/ios/ImageCachePolicy.swift +24 -0
  195. package/ios/ImageCacheType.swift +21 -0
  196. package/ios/ImageModule.swift +127 -0
  197. package/ios/ImagePriority.swift +22 -0
  198. package/ios/ImageSource.swift +44 -0
  199. package/ios/ImageTransition.swift +67 -0
  200. package/ios/ImageUtils.swift +227 -0
  201. package/ios/ImageView.swift +469 -0
  202. package/ios/Loaders/PhotoLibraryAssetLoader.swift +146 -0
  203. package/ios/Thumbhash.swift +550 -0
  204. package/ios/ThumbhashLoader.swift +53 -0
  205. package/jest.config.js +3 -0
  206. package/kepler/ExpoImage.cpp +63 -0
  207. package/kepler/ExpoImage.h +29 -0
  208. package/kepler/ExpoImageCacheHandler.cpp +15 -0
  209. package/kepler/ExpoImageCacheHandler.h +28 -0
  210. package/kepler/ExpoImageComponent.cpp +579 -0
  211. package/kepler/ExpoImageComponent.h +199 -0
  212. package/kepler/ImageWrapper/BlurhashImageWrapper.cpp +37 -0
  213. package/kepler/ImageWrapper/BlurhashImageWrapper.h +23 -0
  214. package/kepler/ImageWrapper/CacheImageWrapper.cpp +80 -0
  215. package/kepler/ImageWrapper/CacheImageWrapper.h +41 -0
  216. package/kepler/ImageWrapper/HashImageWrapper.cpp +21 -0
  217. package/kepler/ImageWrapper/HashImageWrapper.h +22 -0
  218. package/kepler/ImageWrapper/ImageWrapper.cpp +24 -0
  219. package/kepler/ImageWrapper/ImageWrapper.h +33 -0
  220. package/kepler/ImageWrapper/LocalImageWrapper.cpp +61 -0
  221. package/kepler/ImageWrapper/LocalImageWrapper.h +30 -0
  222. package/kepler/ImageWrapper/ThumbhashImageWrapper.cpp +33 -0
  223. package/kepler/ImageWrapper/ThumbhashImageWrapper.h +20 -0
  224. package/kepler/KeplerImageViewComponent.h +64 -0
  225. package/kepler/KeplerInit.cpp +35 -0
  226. package/kepler/blurhash/common.h +32 -0
  227. package/kepler/blurhash/decode.cpp +187 -0
  228. package/kepler/blurhash/decode.h +58 -0
  229. package/kepler/contentposition/ImageContentPosition.cpp +86 -0
  230. package/kepler/contentposition/ImageContentPosition.h +48 -0
  231. package/kepler/enums/ImageContentFit.h +17 -0
  232. package/kepler/enums/ImagePriority.h +17 -0
  233. package/kepler/managers/ExpoImageManager.cpp +38 -0
  234. package/kepler/managers/ExpoImageManager.h +23 -0
  235. package/kepler/test/ExpoImage.cpp +73 -0
  236. package/kepler/test/ExpoImageComponent.cpp +290 -0
  237. package/kepler/test/blurhash/decode.cpp +39 -0
  238. package/kepler/test/contentposition/ImageContentPosition.cpp +100 -0
  239. package/kepler/test/managers/ExpoImageManager.cpp +39 -0
  240. package/kepler/test/thumbhash/decode.cpp +18 -0
  241. package/kepler/test/utils/LoaderDelegate.cpp +130 -0
  242. package/kepler/thumbhash/decode.cpp +166 -0
  243. package/kepler/thumbhash/decode.h +22 -0
  244. package/kepler/utils/PlaceholderImageLoaderDelegate.cpp +26 -0
  245. package/kepler/utils/PlaceholderImageLoaderDelegate.h +26 -0
  246. package/kepler/utils/PrefetchImageLoaderDelegate.cpp +55 -0
  247. package/kepler/utils/PrefetchImageLoaderDelegate.h +35 -0
  248. package/kepler/utils/SourceImageLoaderDelegate.cpp +47 -0
  249. package/kepler/utils/SourceImageLoaderDelegate.h +42 -0
  250. package/kepler/utils/SourceImageLoaderDelegateEmitter.cpp +15 -0
  251. package/kepler/utils/SourceImageLoaderDelegateEmitter.h +28 -0
  252. package/kepler-compatibility.json +8 -0
  253. package/package.json +1 -0
  254. package/react-native.config.js +22 -0
  255. package/src/ExpoImage.kepler.tsx +119 -0
  256. package/src/ExpoImage.tsx +119 -0
  257. package/src/ExpoImage.web.tsx +155 -0
  258. package/src/ExpoImageModules.kepler.ts +7 -0
  259. package/src/ExpoImageModules.ts +4 -0
  260. package/src/Image.tsx +82 -0
  261. package/src/Image.types.ts +450 -0
  262. package/src/ImageBackground.tsx +18 -0
  263. package/src/ImageViewNativeComponent.ts +59 -0
  264. package/src/NativeImageLoaderKepler.ts +22 -0
  265. package/src/fabric/registerNativeComponent.ts +70 -0
  266. package/src/index.ts +3 -0
  267. package/src/utils/AssetSourceResolver.web.ts +88 -0
  268. package/src/utils/blurhash/base83.ts +104 -0
  269. package/src/utils/blurhash/decode.ts +114 -0
  270. package/src/utils/blurhash/error.ts +7 -0
  271. package/src/utils/blurhash/useBlurhash.tsx +81 -0
  272. package/src/utils/blurhash/utils.ts +21 -0
  273. package/src/utils/resolveAssetSource.tsx +3 -0
  274. package/src/utils/resolveAssetSource.web.ts +40 -0
  275. package/src/utils/resolveHashString.tsx +36 -0
  276. package/src/utils/resolveHashString.web.tsx +33 -0
  277. package/src/utils/resolveSources.tsx +48 -0
  278. package/src/utils/thumbhash/thumbhash.ts +387 -0
  279. package/src/utils.ts +109 -0
  280. package/src/web/AnimationManager.tsx +224 -0
  281. package/src/web/ColorTintFilter.tsx +36 -0
  282. package/src/web/ImageWrapper.tsx +85 -0
  283. package/src/web/ImageWrapper.types.ts +36 -0
  284. package/src/web/getImageWrapperEventHandler.ts +29 -0
  285. package/src/web/hooks.ts +72 -0
  286. package/src/web/imageStyles.tsx +136 -0
  287. package/src/web/positioning.ts +48 -0
  288. package/src/web/useSourceSelection.ts +151 -0
  289. package/tsconfig.json +9 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,2 @@
1
+ // @generated by expo-module-scripts
2
+ module.exports = require('expo-module-scripts/eslintrc.base.js');
package/CHANGELOG.md ADDED
@@ -0,0 +1,285 @@
1
+ # Changelog
2
+
3
+ ## Unpublished
4
+
5
+ ### 🛠 Breaking changes
6
+
7
+ ### 🎉 New features
8
+
9
+ ### 🐛 Bug fixes
10
+
11
+ ### 💡 Others
12
+
13
+ ## 1.6.0 — 2023-10-17
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - Dropped support for Android SDK 21 and 22. ([#24201](https://github.com/expo/expo/pull/24201) by [@behenate](https://github.com/behenate))
18
+
19
+ ### 🎉 New features
20
+
21
+ - Added support for the `headers` key in the `source` object on web. ([#24447](https://github.com/expo/expo/pull/24447) by [@aleqsio](https://github.com/aleqsio))
22
+ - Add support for setting `tintColor` on SVGs on Android (part 1) ([#24733](https://github.com/expo/expo/pull/24733) by [@alanjhughes](https://github.com/alanjhughes) and [@kadikraman](https://github.com/kadikraman))
23
+ - Add support for setting `tintColor` on SVGs on Android (part 2) ([#24888](https://github.com/expo/expo/pull/24888) by [@kadikraman](https://github.com/kadikraman))
24
+
25
+ ### 🐛 Bug fixes
26
+
27
+ - Remove `GlideWebpDecoder` until they update their `libwebp` dependency. ([#24656](https://github.com/expo/expo/pull/24656) by [@alanjhughes](https://github.com/alanjhughes))
28
+ - [web] Fix content fit not being applied correctly when using hash placeholders. ([#24542](https://github.com/expo/expo/pull/24542) by [@aleqsio](https://github.com/aleqsio))
29
+ - [macCatalyst] Fix build with `ImageAnalyzer` on macCatalyst below 17.0. ([#24880](https://github.com/expo/expo/pull/24880) by [@kesha-antonov](https://github.com/kesha-antonov))
30
+
31
+ ### 💡 Others
32
+
33
+ - Ship untranspiled JSX to support custom handling of `jsx` and `createElement`. ([#24889](https://github.com/expo/expo/pull/24889) by [@EvanBacon](https://github.com/EvanBacon))
34
+ - Make `placeholderContentFit` visible in the docs. ([#24801](https://github.com/expo/expo/pull/24801) by [@behenate](https://github.com/behenate))
35
+
36
+ ## 1.0.2 — 2023-09-29
37
+
38
+ ### 🐛 Bug fixes
39
+
40
+ - Remove `GlideWebpDecoder` until they update their `libwebp` dependency. ([#24656](https://github.com/expo/expo/pull/24656) by [@alanjhughes](https://github.com/alanjhughes))
41
+
42
+ ## 1.3.4 — 2023-09-28
43
+
44
+ ### 🐛 Bug fixes
45
+
46
+ - Remove `GlideWebpDecoder` until they update their `libwebp` dependency. ([#24656](https://github.com/expo/expo/pull/24656) by [@alanjhughes](https://github.com/alanjhughes))
47
+
48
+ ## 1.5.2 — 2023-09-18
49
+
50
+ _This version does not introduce any user-facing changes._
51
+
52
+ ## 1.3.3 — 2023-09-15
53
+
54
+ ### 🐛 Bug fixes
55
+
56
+ - 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))
57
+ - 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))
58
+ - Fixed gif and awebp memory leak on Android. ([#24259](https://github.com/expo/expo/pull/24259) by [@jingpeng](https://github.com/jingpeng))
59
+ - 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))
60
+
61
+ ## 1.5.1 — 2023-09-11
62
+
63
+ ### 🐛 Bug fixes
64
+
65
+ - 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))
66
+ - Fixed gif and awebp memory leak on Android. ([#24259](https://github.com/expo/expo/pull/24259) by [@jingpeng](https://github.com/jingpeng))
67
+
68
+ ## 1.5.0 — 2023-09-04
69
+
70
+ ### 🎉 New features
71
+
72
+ - Added support for React Native 0.73. ([#24018](https://github.com/expo/expo/pull/24018) by [@kudo](https://github.com/kudo))
73
+
74
+ ### 💡 Others
75
+
76
+ - On iOS, bump SDWebImage versions. ([#23858](https://github.com/expo/expo/pull/23858) by [@alanjhughes](https://github.com/alanjhughes))
77
+
78
+ ## 1.4.1 — 2023-08-02
79
+
80
+ _This version does not introduce any user-facing changes._
81
+
82
+ ## 1.4.0 — 2023-07-28
83
+
84
+ ### 🎉 New features
85
+
86
+ - [Web] Add support for `tintColor` prop on web. ([#23434](https://github.com/expo/expo/pull/23434) by [@aleqsio](https://github.com/aleqsio))
87
+ - [Web] Add support for static image responsiveness using `srcset` attributes. ([#22088](https://github.com/expo/expo/pull/22088) by [@aleqsio](https://github.com/aleqsio))
88
+
89
+ ### 🐛 Bug fixes
90
+
91
+ - 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))
92
+ - Fixed 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))
93
+
94
+ ### 💡 Others
95
+
96
+ - [Web] Refactored and split some functions for better readability. ([#23465](https://github.com/expo/expo/pull/23465) by [@aleqsio](https://github.com/aleqsio))
97
+
98
+ ## 1.3.2 - 2023-07-12
99
+
100
+ ### 🐛 Bug fixes
101
+
102
+ - [iOS] Fixed `tintColor` prop not working for SVGs. ([#23418](https://github.com/expo/expo/pull/23418) by [@tsapeta](https://github.com/tsapeta))
103
+
104
+ ## 1.3.1 - 2023-06-29
105
+
106
+ ### 🐛 Bug fixes
107
+
108
+ - Fixed an issue where recyclingKey would reset the image source on mount. ([#23187](https://github.com/expo/expo/pull/23187) by [@hirbod](https://github.com/hirbod))
109
+
110
+ ## 1.3.0 — 2023-06-13
111
+
112
+ ### 🎉 New features
113
+
114
+ - Add prefetch implementation on web. ([#22630](https://github.com/expo/expo/pull/22630) by [@aleqsio](https://github.com/aleqsio))
115
+ - Add `ImageBackground` component. ([#22347](https://github.com/expo/expo/pull/22347) by [@alanjhughes](https://github.com/alanjhughes))
116
+ - Added support for React Native 0.72. ([#22588](https://github.com/expo/expo/pull/22588) by [@kudo](https://github.com/kudo))
117
+
118
+ ### 🐛 Bug fixes
119
+
120
+ - Fixed styles order breaking layouting on web. ([#22630](https://github.com/expo/expo/pull/22630) by [@aleqsio](https://github.com/aleqsio))
121
+ - Uses prop spreading on web to pass all unused props to the native image component ([#22340](https://github.com/expo/expo/pull/22340) by [@makkarMeenu](https://github.com/makkarMeenu))
122
+ - Fixed Android build warnings for Gradle version 8. ([#22537](https://github.com/expo/expo/pull/22537), [#22609](https://github.com/expo/expo/pull/22609) by [@kudo](https://github.com/kudo))
123
+
124
+ ### 💡 Others
125
+
126
+ - Updated `SDWebImage` to `5.15.8`, `SDWebImageWebPCoder` to `0.11.0` and `SDWebImageSVGCoder` to `1.7.0`. ([#22576](https://github.com/expo/expo/pull/22576) by [@tsapeta](https://github.com/tsapeta))
127
+
128
+ ## 1.2.3 — 2023-05-16
129
+
130
+ ### 🐛 Bug fixes
131
+
132
+ - Upgrade SDWebImageAVIFCoder to fix compiling issue with libavif < 0.11.0. ([#22491](https://github.com/expo/expo/pull/22491) by [@matinzd](https://github.com/matinzd))
133
+
134
+ ## 1.2.2 — 2023-04-27
135
+
136
+ ### 🐛 Bug fixes
137
+
138
+ - Fix for the "limited" media library permission. ([#22261](https://github.com/expo/expo/pull/22261) by [@tsapeta](https://github.com/tsapeta))
139
+
140
+ ## 1.2.1 — 2023-04-17
141
+
142
+ ### 🐛 Bug fixes
143
+
144
+ - [Android] Fix `url` property returned by the `onLoad` event. ([#22161](https://github.com/expo/expo/pull/22161) by [@lukmccall](https://github.com/lukmccall))
145
+ - [Android] Fix images not loading after the app was foregrounded. ([#22159](https://github.com/expo/expo/pull/22159) by [@lukmccall](https://github.com/lukmccall))
146
+ - [Android] Fixed image was loaded event if the view dimensions were 0. ([#22157](https://github.com/expo/expo/pull/22157) by [@lukmccall](https://github.com/lukmccall))
147
+ - Fix generating the image from ThumbHash that starts with a slash character. ([#22160](https://github.com/expo/expo/pull/22160) by [@tsapeta](https://github.com/tsapeta))
148
+
149
+ ## 1.2.0 — 2023-04-14
150
+
151
+ ### 🎉 New features
152
+
153
+ - [Web] Add support for `require()` assets. ([#21798](https://github.com/expo/expo/pull/21798) by [@aleqsio](https://github.com/aleqsio))
154
+ - Add `alt` prop as an alias to `accessibilityLabel`. ([#21884](https://github.com/expo/expo/pull/21884) by [@EvanBacon](https://github.com/EvanBacon))
155
+ - [Web] Add `accessibilityLabel` support on web. ([#21884](https://github.com/expo/expo/pull/21884) by [@EvanBacon](https://github.com/EvanBacon))
156
+ - Added `ThumbHash` support for Android, iOS and Web. ([#21952](https://github.com/expo/expo/pull/21952) by [@behenate](https://github.com/behenate))
157
+
158
+ ### 🐛 Bug fixes
159
+
160
+ - [Web] Improve transition behavior when switching back and forth two sources. ([#22099](https://github.com/expo/expo/pull/22099) by [@aleqsio](https://github.com/aleqsio))
161
+ - [Web] Prevent breaking in static rendering environments. ([#21883](https://github.com/expo/expo/pull/21883) by [@EvanBacon](https://github.com/EvanBacon))
162
+ - [Android] Fixed image disappearing before navigation animation is complete. ([#22066](https://github.com/expo/expo/pull/22066) by [@sallen450](https://github.com/sallen450))
163
+ - [Web] Fixed monorepo asset resolution in production for Metro web. ([#22094](https://github.com/expo/expo/pull/22094) by [@EvanBacon](https://github.com/EvanBacon))
164
+
165
+ ## 1.1.0 — 2023-03-25
166
+
167
+ ### 🎉 New features
168
+
169
+ - [Android] Add automatic asset downscaling to improve performance. ([#21628](https://github.com/expo/expo/pull/21628) by [@lukmccall](https://github.com/lukmccall))
170
+
171
+ ### 🐛 Bug fixes
172
+
173
+ - Fixed the `tintColor` not being passed to native view. ([#21576](https://github.com/expo/expo/pull/21576) by [@andrew-levy](https://github.com/andrew-levy))
174
+ - Fixed `canvas: trying to use a recycled bitmap` on Android. ([#21658](https://github.com/expo/expo/pull/21658) by [@lukmccall](https://github.com/lukmccall))
175
+ - Fixed crashes caused by empty placeholder or source on Android. ([#21695](https://github.com/expo/expo/pull/21695) by [@lukmccall](https://github.com/lukmccall))
176
+ - Fixes `shouldDownscale` don't respect the scale factor on iOS. ([#21839](https://github.com/expo/expo/pull/21839) by [@ouabing](https://github.com/ouabing))
177
+ - Fixes cache policy not being correctly applied when set to `none` on iOS. ([#21840](https://github.com/expo/expo/pull/21840) by [@ouabing](https://github.com/ouabing))
178
+
179
+ ## 1.0.0 — 2023-02-21
180
+
181
+ _This version does not introduce any user-facing changes._
182
+
183
+ ## 1.0.0-rc.2 — 2023-02-20
184
+
185
+ ### 🎉 New features
186
+
187
+ - Added `recyclingKey` prop that allows reseting the image view content when the view is recycled. ([#21297](https://github.com/expo/expo/pull/21297) & [#21309](https://github.com/expo/expo/pull/21309) by [@tsapeta](https://github.com/tsapeta) & [@lukmccall](https://github.com/lukmccall))
188
+
189
+ ## 1.0.0-rc.1 — 2023-02-14
190
+
191
+ ### 🐛 Bug fixes
192
+
193
+ - Fixed `You can't start or clear loads in RequestListener or Target callbacks` on Android. ([#21192](https://github.com/expo/expo/pull/21192) by [@lukmccall](https://github.com/lukmccall))
194
+ - Fixed SVGs are not rendered in the release mode on Android. ([#21214](https://github.com/expo/expo/pull/21214) by [@lukmccall](https://github.com/lukmccall))
195
+ - Stop sending `onProgress` event when the asset size is unknown which led to diving by zero and a crash. ([#21215](https://github.com/expo/expo/pull/21215) by [@tsapeta](https://github.com/tsapeta))
196
+
197
+ ## 1.0.0-rc.0 — 2023-02-09
198
+
199
+ ### 🎉 New features
200
+
201
+ - Added `placeholderContentFit` prop implementation on the web. ([#21106](https://github.com/expo/expo/pull/21106) by [@aleqsio](https://github.com/aleqsio))
202
+
203
+ ## 1.0.0-beta.6 — 2023-02-06
204
+
205
+ ### 🎉 New features
206
+
207
+ - Added new prop `placeholderContentFit` to specify custom content fit on the placeholder. ([#21096](https://github.com/expo/expo/pull/21096) by [@magrinj](https://github.com/magrinj))
208
+
209
+ ### 🐛 Bug fixes
210
+
211
+ - [iOS] Fixed possible freezes by processing images concurrently off the main thread. ([#21086](https://github.com/expo/expo/pull/21086) by [@tsapeta](https://github.com/tsapeta))
212
+
213
+ ## 1.0.0-beta.5 — 2023-02-03
214
+
215
+ _This version does not introduce any user-facing changes._
216
+
217
+ ## 1.0.0-beta.4 — 2023-01-31
218
+
219
+ ### 🐛 Bug fixes
220
+
221
+ - Fixed a crash on Android where `isScreenReaderFocusable` crashes devices below api 28. ([#21012](https://github.com/expo/expo/pull/21012) by [@alanhughes](https://github.com/alanjhughes))
222
+
223
+ ## 1.0.0-beta.3 — 2023-01-30
224
+
225
+ ### 🐛 Bug fixes
226
+
227
+ - Fixed a crash on iOS below 16.0 introduced by the Live Text interaction feature. ([#20987](https://github.com/expo/expo/pull/20987) by [@tsapeta](https://github.com/tsapeta))
228
+
229
+ ## 1.0.0-beta.2 — 2023-01-25
230
+
231
+ ### 🎉 New features
232
+
233
+ - Added support for Live text interaction. ([#20915](https://github.com/expo/expo/pull/20915) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
234
+
235
+ ### 🐛 Bug fixes
236
+
237
+ - `ImageProps` now extends `ViewProps`. ([#20942](https://github.com/expo/expo/pull/20942) by [@appden](https://github.com/appden))
238
+
239
+ ## 1.0.0-beta.1 — 2023-01-20
240
+
241
+ ### 🐛 Bug fixes
242
+
243
+ - Use `SDImageAWebPCoder` on iOS 14+ to speed up loading WebP images. ([#20897](https://github.com/expo/expo/pull/20897) by [@tsapeta](https://github.com/tsapeta))
244
+
245
+ ### 💡 Others
246
+
247
+ - On Android bump `compileSdkVersion` and `targetSdkVersion` to `33`. ([#20721](https://github.com/expo/expo/pull/20721) by [@lukmccall](https://github.com/lukmccall))
248
+ - Upgraded `SDWebImage` to `5.15.0` and `SDWebImageAVIFCoder` to `0.9.4`. ([#20898](https://github.com/expo/expo/pull/20898) by [@tsapeta](https://github.com/tsapeta))
249
+
250
+ ## 1.0.0-beta.0 — 2023-01-19
251
+
252
+ ### 🎉 New features
253
+
254
+ - Added support for crossfade transition on Android. ([#20784](https://github.com/expo/expo/pull/20784) by [@lukmccall](https://github.com/lukmccall))
255
+ - Added web support for the `blurRadius` prop. ([#20845](https://github.com/expo/expo/pull/20845) by [@aleqsio](https://github.com/aleqsio))
256
+ - Support for `accessible` and `accessibilityLabel` props on Android. ([#20801](https://github.com/expo/expo/pull/20801) by [@lukmccall](https://github.com/lukmccall))
257
+ - Support for `accessible` and `accessibilityLabel` props on iOS. ([#20892](https://github.com/expo/expo/pull/20892) by [@alanhughes](https://github.com/alanjhughes))
258
+
259
+ ## 1.0.0-alpha.6 — 2023-01-10
260
+
261
+ ### 🎉 New features
262
+
263
+ - Introduced the `source.cacheKey` parameter to customize the key used for caching the source image. ([#20772](https://github.com/expo/expo/pull/20772) by [@tsapeta](https://github.com/tsapeta), [#20776](https://github.com/expo/expo/pull/20776) by [@lukmccall](https://github.com/lukmccall))
264
+
265
+ ## 1.0.0-alpha.5 — 2023-01-04
266
+
267
+ ### 🎉 New features
268
+
269
+ - Added support for assets from the iOS Photo Library (`ph://` urls). ([#20700](https://github.com/expo/expo/pull/20700) by [@tsapeta](https://github.com/tsapeta))
270
+
271
+ ### 🐛 Bug fixes
272
+
273
+ - Fixed `ImageProps` type not allowing an array of styles. ([#20701](https://github.com/expo/expo/pull/20701) by [@tsapeta](https://github.com/tsapeta))
274
+
275
+ ## 1.0.0-alpha.4 — 2022-12-30
276
+
277
+ ### 🐛 Bug fixes
278
+
279
+ - Fixed compatibility with `react-native-shared-element` on iOS. ([#20592](https://github.com/expo/expo/pull/20592) by [@IjzerenHein](https://github.com/ijzerenhein))
280
+
281
+ ## 1.0.0-alpha.3 — 2022-12-21
282
+
283
+ ### 🎉 New features
284
+
285
+ - Initial release 🥳
package/CMakeLists.txt ADDED
@@ -0,0 +1,91 @@
1
+ #
2
+ # Copyright 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
3
+ #
4
+ # AMAZON PROPRIETARY/CONFIDENTIAL
5
+ #
6
+ # You may not use this file except in compliance with the terms and conditions
7
+ # set forth in the accompanying LICENSE.TXT file.
8
+ #
9
+ # THESE MATERIALS ARE PROVIDED ON AN "AS IS" BASIS. AMAZON SPECIFICALLY
10
+ # DISCLAIMS, WITH RESPECT TO THESE MATERIALS, ALL WARRANTIES, EXPRESS,
11
+ # IMPLIED, OR STATUTORY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
12
+ # FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
13
+ #
14
+ set(PACKAGE_NAME "expo-image")
15
+ set(AUTO_LINK_PACKAGE_NAME "${PACKAGE_NAME}-${KEPLER_REACT_NATIVE_MAJOR_VERSION}")
16
+ set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/kepler)
17
+ set(SOURCES_KEPLER
18
+ kepler/ExpoImage.cpp
19
+ kepler/ExpoImageCacheHandler.cpp
20
+ kepler/ExpoImageComponent.cpp
21
+
22
+ kepler/utils/PlaceholderImageLoaderDelegate.cpp
23
+ kepler/utils/PrefetchImageLoaderDelegate.cpp
24
+ kepler/utils/SourceImageLoaderDelegate.cpp
25
+ kepler/utils/SourceImageLoaderDelegateEmitter.cpp
26
+
27
+ kepler/contentposition/ImageContentPosition.cpp
28
+
29
+ kepler/blurhash/decode.cpp
30
+
31
+ kepler/thumbhash/decode.cpp
32
+
33
+ kepler/ImageWrapper/BlurhashImageWrapper.cpp
34
+ kepler/ImageWrapper/CacheImageWrapper.cpp
35
+ kepler/ImageWrapper/HashImageWrapper.cpp
36
+ kepler/ImageWrapper/ImageWrapper.cpp
37
+ kepler/ImageWrapper/LocalImageWrapper.cpp
38
+ kepler/ImageWrapper/ThumbhashImageWrapper.cpp
39
+
40
+ kepler/managers/ExpoImageManager.cpp
41
+ )
42
+
43
+ set(KEPLER_INIT kepler/KeplerInit.cpp)
44
+
45
+ find_library (MBED_CRYPTO NAMES mbedcrypto REQUIRED)
46
+
47
+ add_library(${PACKAGE_NAME} STATIC ${SOURCES_KEPLER})
48
+
49
+
50
+ target_include_directories(
51
+ ${PACKAGE_NAME}
52
+ PUBLIC
53
+ ${SRC_DIR}
54
+ )
55
+
56
+ target_link_libraries(
57
+ ${PACKAGE_NAME}
58
+ PUBLIC
59
+ keplerui::keplerscript-${KEPLER_REACT_NATIVE_MAJOR_VERSION}
60
+ ${MBED_CRYPTO}
61
+ )
62
+
63
+ target_compile_options(
64
+ ${PACKAGE_NAME}
65
+ PRIVATE
66
+ -fpermissive
67
+ )
68
+
69
+ add_library(${AUTO_LINK_PACKAGE_NAME} SHARED ${KEPLER_INIT} ${SOURCES_KEPLER})
70
+
71
+ set_target_properties(${AUTO_LINK_PACKAGE_NAME} PROPERTIES SOVERSION ${KEPLER_REACT_NATIVE_MAJOR_VERSION}.${KEPLER_REACT_NATIVE_MINOR_VERSION})
72
+
73
+ target_link_libraries(
74
+ ${AUTO_LINK_PACKAGE_NAME}
75
+ PRIVATE
76
+ ${PACKAGE_NAME}
77
+ )
78
+
79
+ # Helps in checking undefined references
80
+ add_executable(${AUTO_LINK_PACKAGE_NAME}_exe ${KEPLER_INIT} ${SOURCES_KEPLER})
81
+ target_link_libraries(${AUTO_LINK_PACKAGE_NAME}_exe
82
+ PRIVATE
83
+ ${AUTO_LINK_PACKAGE_NAME}
84
+ keplerui::keplerscript-${KEPLER_REACT_NATIVE_MAJOR_VERSION}
85
+ ${MBED_CRYPTO}
86
+ )
87
+ target_include_directories(${AUTO_LINK_PACKAGE_NAME}_exe PRIVATE ${SRC_DIR})
88
+
89
+ install(TARGETS ${AUTO_LINK_PACKAGE_NAME}
90
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
91
+ )
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
2
+
3
+ These materials are licensed as "Program Materials" under the Program Materials License Agreement (the "Agreement"). The Agreement is available at https://developer.amazon.com/support/legal/pml. See the Agreement for the specific terms and conditions of the Agreement. Capitalized terms not defined in this file have the meanings given to them in the Agreement.
4
+
5
+ If you do not agree to the above terms and conditions, you may not use any file in this package.
6
+
7
+ YOUR USE OF THE PROGRAM MATERIALS IN OR ASSOCIATED WITH THIS PACKAGE IS AT YOUR SOLE RISK. IN NO EVENT WILL AMAZON BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES (INCLUDING FOR ANY LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, OR COMPUTER FAILURE OR MALFUNCTION) ARISING FROM OR RELATING TO SUCH PROGRAM MATERIALS, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, EVEN IF AMAZON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS AND DISCLAIMERS APPLY EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW.
@@ -0,0 +1,123 @@
1
+ # @amazon-devices/expo-image
2
+
3
+ ## Getting Started
4
+
5
+ `@amazon-devices/expo-image` provides a cross-platform, performant image component for React Native and Expo.
6
+
7
+ Provides `Image` component that:
8
+ - Supports [BlurHash](https://blurha.sh) and [ThumbHash](https://evanw.github.io/thumbhash/) - compact representations of a placeholder for an image
9
+ - Transitioning between images when the source changes (no more flickering!)
10
+ - Implements the CSS [`object-fit`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) and [`object-position`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) properties (see [`contentFit`](#contentfit) and [`contentPosition`](#contentposition) props)
11
+
12
+ ### Installation
13
+
14
+ 1. Add the JavaScript library dependency in the `package.json` file:
15
+ ```json
16
+ dependencies: {
17
+ ...
18
+ "@amazon-devices/expo-image": "~2.0.0",
19
+ }
20
+ ```
21
+
22
+ 2. Reinstall dependencies using `npm install` command.
23
+
24
+ ## Usage Examples
25
+
26
+ Example of image with thumbhash placeholder and multiple sources
27
+
28
+
29
+ ```tsx
30
+ import React from 'react';
31
+ import {StyleSheet, View} from 'react-native';
32
+ import {Image} from '@amazon-devices/expo-image';
33
+
34
+ export const App = () => {
35
+ return (
36
+ <View style={styles.container}>
37
+ <Image
38
+ source={[
39
+ 'https://images.pexels.com/photos/842711/pexels-photo-842711.jpeg',
40
+ 'https://climateforlife.pl/wp-content/uploads/2023/10/panda.png',
41
+ ]}
42
+ style={styles.image}
43
+ placeholder="thumbhash:/1QcSHQRnh493V4dIh4eXh1h4kJUI"
44
+ />
45
+ </View>
46
+ );
47
+ };
48
+
49
+ const styles = StyleSheet.create({
50
+ container: {
51
+ backgroundColor: 'white',
52
+ flex: 1,
53
+ },
54
+ image: {
55
+ width: 300,
56
+ aspectRatio: 1,
57
+ },
58
+ });
59
+
60
+
61
+ ```
62
+
63
+ ## API Reference
64
+
65
+ Check out the dedicated documentation page for info about this library, API reference and more [Official Expo documentation for expo-image](https://github.com/expo/expo/blob/sdk-49/docs/pages/versions/v49.0.0/sdk/image.mdx).
66
+
67
+ ### Components
68
+
69
+ | Component | Description | Platform support |
70
+ | --------- | ----------- | ---------------- |
71
+ | Image | A cross-platform React component that loads and renders images | All |
72
+
73
+ ### Image Props
74
+
75
+ | Prop | Description | Platform support |
76
+ | ---- | ----------- | ---------------- |
77
+ | accessibilityLabel | 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 | All |
78
+ | accessible | When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component | All |
79
+ | allowDownscaling | Whether the image should be downscaled to match the size of the view container. Turning off this functionality could negatively impact the application's performance, particularly when working with large assets. However, it would result in smoother image resizing, and end-users would always have access to the highest possible asset quality | Android, Kepler |
80
+ | alt | 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` | All |
81
+ | blurRadius | The radius of the blur in points, 0 means no blur effect. This effect is not applied to placeholders | All |
82
+ | cachePolicy | Determines whether to cache the image and where: on the disk, in the memory or both | Android, iOS |
83
+ | contentFit | Determines how the image should be resized to fit its container. This property tells the image to fill the container in a variety of ways; such as "preserve that aspect ratio" or "stretch up and take up as much space as possible". It mirrors the CSS `object-fit` property | All |
84
+ | contentPosition | It is used together with `contentFit` to specify how the image should be positioned with x/y coordinates inside its own container. An equivalent of the CSS `object-position` property | All |
85
+ | defaultSource | A default value for the image source. WARNING: Deprecated. Provides compatibility for defaultSource from React Native Image. Use placeholder prop instead | All |
86
+ | enableLiveTextInteraction | Enables Live Text interaction with the image | iOS |
87
+ | fadeDuration | WARNING: Deprecated. Provides compatibility for `fadeDuration` from React Native Image. Instead use transition with the provided duration | All |
88
+ | focusable | Whether this View should be focusable with a non-touch input device and receive focus with a hardware keyboard | Android, Kepler |
89
+ | loadingIndicatorSource | WARNING: Deprecated. Provides compatibility for `loadingIndicatorSource` from React Native Image. Use placeholder prop instead | All |
90
+ | onError | Called on an image fetching error | All |
91
+ | onLoad | Called when the image load completes successfully | All |
92
+ | onLoadEnd | Called when the image load either succeeds or fails | All |
93
+ | onLoadStart | Called when the image starts to load | All |
94
+ | onProgress | Called when the image is loading. Can be called multiple times before the image has finished loading. The event object provides details on how many bytes were loaded so far and what's the expected total size | All |
95
+ | placeholder | An image to display while loading the proper image and no image has been displayed yet or the source is unset | All |
96
+ | priority | Priorities for completing loads. If more than one load is queued at a time, the load with the higher priority will be started first. Priorities are considered best effort, there are no guarantees about the order in which loads will start or finish | All |
97
+ | recyclingKey | Changing this prop resets the image view content to blank or a placeholder before loading and rendering the final image. This is especially useful for any kinds of recycling views like FlashList to prevent showing the previous source before the new one fully loads | All |
98
+ | resizeMode | WARNING: Deprecated. Provides compatibility for `resizeMode` from React Native Image. Note that `"repeat"` option is not supported at all. Use the more powerful `contentFit` and `contentPosition` props instead | All |
99
+ | responsivePolicy | Determines whether to choose image source based on container size only on mount or on every resize. Use initial to improve performance | Web |
100
+ | source | The image source, either a remote URL, a local file resource or a number that is the result of the require() function. When provided as an array of sources, the source that fits best into the container size and is closest to the screen scale will be chosen. In this case it is important to provide `width`, `height` and `scale` properties | All |
101
+ | tintColor | A color used to tint template images (a bitmap image where only the opacity matters). The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color. This effect is not applied to placeholders | All |
102
+ | transition | Describes how the image view should transition the contents when switching the image source. If provided as a number, it is the duration in milliseconds of the `'cross-dissolve'` effect | All |
103
+
104
+ ### Methods
105
+
106
+ | Method | Method type | Description | Platform support |
107
+ | ------ | ----------- | ----------- | ---------------- |
108
+ | clearDiskCache | Asynchronously clears all images from the disk cache | All |
109
+ | clearMemoryCache | Asynchronously clears all images stored in memory | All |
110
+ | prefetch | Preloads images at the given urls that can be later used in the image view. Preloaded images are always cached on the disk, so make sure to use `disk` (default) or `memory-disk` cache policy | All |
111
+
112
+ ## Known Issues
113
+
114
+ * Does not support SVG's and animated sources
115
+ * `cachePolicy` prop does not work
116
+ * `onProgress` and `onError` callbacks don't work on Kepler
117
+ * `onLoadEnd`, `onLoadStart`, `onLoad` sometimes don't get invoked on Kepler
118
+
119
+ ## Supported Versions
120
+
121
+ | Package version | Based on | @amazon-devices/react-native-kepler version |
122
+ | ---------------- | -------- | --------------------------------- |
123
+ | 2.0.x | expo-image v1.6.0 | 2.0.x |
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ <p>
2
+ <a href="https://docs.expo.dev/versions/unversioned/sdk/image/">
3
+ <img
4
+ src="../../.github/resources/expo-image.svg"
5
+ alt="expo-image"
6
+ height="64" />
7
+ </a>
8
+ </p>
9
+
10
+ A cross-platform, performant image component for React Native and Expo.
11
+
12
+ ## Main features
13
+
14
+ - Designed for speed
15
+ - Support for many image formats (including animated ones)
16
+ - Disk and memory caching
17
+ - Supports [BlurHash](https://blurha.sh) and [ThumbHash](https://evanw.github.io/thumbhash/) - compact representations of a placeholder for an image
18
+ - Transitioning between images when the source changes (no more flickering!)
19
+ - Implements the CSS [`object-fit`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) and [`object-position`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) properties (see [`contentFit`](#contentfit) and [`contentPosition`](#contentposition) props)
20
+ - Uses performant [`SDWebImage`](https://github.com/SDWebImage/SDWebImage) and [`Glide`](https://github.com/bumptech/glide) under the hood
21
+
22
+ ## Supported image formats
23
+
24
+ | Format | Android | iOS | Web |
25
+ | :--------: | :-----: | :-: | :-----------------------------------------------: |
26
+ | WebP | ✅ | ✅ | ✅ [~96% adoption](https://caniuse.com/webp) |
27
+ | PNG / APNG | ✅ | ✅ | ✅ / ✅ [~96% adoption](https://caniuse.com/apng) |
28
+ | AVIF | ✅ | ✅ | ⏳ [~79% adoption](https://caniuse.com/avif) |
29
+ | HEIC | ✅ | ✅ | ❌ [not adopted yet](https://caniuse.com/heif) |
30
+ | JPEG | ✅ | ✅ | ✅ |
31
+ | GIF | ✅ | ✅ | ✅ |
32
+ | SVG | ✅ | ✅ | ✅ |
33
+ | ICO | ✅ | ✅ | ✅ |
34
+ | ICNS | ❌ | ✅ | ❌ |
35
+
36
+ # API documentation
37
+
38
+ - [Documentation for the latest release](https://docs.expo.dev/versions/unversioned/sdk/image/)
39
+
40
+ # Installation
41
+
42
+ > Currently `expo-image` can be used only with [development builds](https://docs.expo.dev/develop/development-builds/introduction/), in Expo Go, and bare React Native apps with [configured Expo modules](https://docs.expo.dev/bare/installing-expo-modules/).
43
+ > It is not available with Snack yet.
44
+
45
+ Add the package to your dependencies with the following commands:
46
+
47
+ ```
48
+ npx expo install expo-image
49
+ npx pod-install
50
+ ```
51
+
52
+ # Contributing
53
+
54
+ Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
@@ -0,0 +1,24 @@
1
+ License from package.json:
2
+ ==============================
3
+
4
+ The MIT License (MIT)
5
+
6
+ Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.