From 286e23428c03e59a334680a438b0a001b1cf1fd7 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Wed, 7 Feb 2024 14:23:20 +0100 Subject: [PATCH 01/12] Migrate to expo image manipulator --- ios/Podfile.lock | 16 ++- package-lock.json | 20 +++ package.json | 1 + .../AvatarCropModal/AvatarCropModal.tsx | 3 +- .../API/parameters/UpdateUserAvatarParams.ts | 2 +- src/libs/actions/PersonalDetails.ts | 2 +- src/libs/cropOrRotateImage.ts | 57 ++++++++ src/libs/cropOrRotateImage/index.native.ts | 22 --- src/libs/cropOrRotateImage/index.ts | 127 ------------------ src/libs/cropOrRotateImage/types.ts | 25 ---- 10 files changed, 96 insertions(+), 179 deletions(-) create mode 100644 src/libs/cropOrRotateImage.ts delete mode 100644 src/libs/cropOrRotateImage/index.native.ts delete mode 100644 src/libs/cropOrRotateImage/index.ts delete mode 100644 src/libs/cropOrRotateImage/types.ts diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1664c982ce50..e2a351df1c4a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -32,6 +32,9 @@ PODS: - React-Core - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) + - EXImageLoader (4.6.0): + - ExpoModulesCore + - React-Core - Expo (50.0.4): - ExpoModulesCore - ExpoImage (1.10.1): @@ -40,6 +43,9 @@ PODS: - SDWebImageAVIFCoder (~> 0.10.1) - SDWebImageSVGCoder (~> 1.7.0) - SDWebImageWebPCoder (~> 0.13.0) + - ExpoImageManipulator (11.8.0): + - EXImageLoader + - ExpoModulesCore - ExpoModulesCore (1.11.8): - glog - RCT-Folly (= 2022.05.16.00) @@ -1464,8 +1470,10 @@ DEPENDENCIES: - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) - BVLinearGradient (from `../node_modules/react-native-linear-gradient`) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) + - EXImageLoader (from `../node_modules/expo-image-loader/ios`) - Expo (from `../node_modules/expo`) - ExpoImage (from `../node_modules/expo-image/ios`) + - ExpoImageManipulator (from `../node_modules/expo-image-manipulator/ios`) - ExpoModulesCore (from `../node_modules/expo-modules-core`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) @@ -1644,10 +1652,14 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-linear-gradient" DoubleConversion: :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" + EXImageLoader: + :path: "../node_modules/expo-image-loader/ios" Expo: :path: "../node_modules/expo" ExpoImage: :path: "../node_modules/expo-image/ios" + ExpoImageManipulator: + :path: "../node_modules/expo-image-manipulator/ios" ExpoModulesCore: :path: "../node_modules/expo-modules-core" FBLazyVector: @@ -1843,8 +1855,10 @@ SPEC CHECKSUMS: BVLinearGradient: 421743791a59d259aec53f4c58793aad031da2ca CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 + EXImageLoader: 55080616b2fe9da19ef8c7f706afd9814e279b6b Expo: 1e3bcf9dd99de57a636127057f6b488f0609681a ExpoImage: 1cdaa65a6a70bb01067e21ad1347ff2d973885f5 + ExpoImageManipulator: c1d7cb865eacd620a35659f3da34c70531f10b59 ExpoModulesCore: 96d1751929ad10622773bb729ab28a8423f0dd0c FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4 FBReactNativeSpec: 86de768f89901ef6ed3207cd686362189d64ac88 @@ -1922,7 +1936,7 @@ SPEC CHECKSUMS: react-native-image-picker: c33d4e79f0a14a2b66e5065e14946ae63749660b react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d - react-native-live-markdown: 81ac491b913cb8541a06586adcdc159ab1b86fb5 + react-native-live-markdown: 1ca4275d4dba8eebb736a005148f24a8224f54d9 react-native-netinfo: 8a7fd3f7130ef4ad2fb4276d5c9f8d3f28d2df3d react-native-pager-view: 02a5c4962530f7efc10dd51ee9cdabeff5e6c631 react-native-pdf: b4ca3d37a9a86d9165287741c8b2ef4d8940c00e diff --git a/package-lock.json b/package-lock.json index 11099886bfb0..3918ba2acfca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,6 +55,7 @@ "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#4a61536649cbfe49236a35bc7542b5dfd0767e4a", "expo": "^50.0.3", "expo-image": "1.10.1", + "expo-image-manipulator": "11.8.0", "fbjs": "^3.0.2", "htmlparser2": "^7.2.0", "idb-keyval": "^6.2.1", @@ -31335,6 +31336,25 @@ "expo": "*" } }, + "node_modules/expo-image-loader": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/expo-image-loader/-/expo-image-loader-4.6.0.tgz", + "integrity": "sha512-RHQTDak7/KyhWUxikn2yNzXL7i2cs16cMp6gEAgkHOjVhoCJQoOJ0Ljrt4cKQ3IowxgCuOrAgSUzGkqs7omj8Q==", + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-image-manipulator": { + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/expo-image-manipulator/-/expo-image-manipulator-11.8.0.tgz", + "integrity": "sha512-ZWVrHnYmwJq6h7auk+ropsxcNi+LyZcPFKQc8oy+JA0SaJosfShvkCm7RADWAunHmfPCmjHrhwPGEu/rs7WG/A==", + "dependencies": { + "expo-image-loader": "~4.6.0" + }, + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-keep-awake": { "version": "12.8.2", "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-12.8.2.tgz", diff --git a/package.json b/package.json index 71983e0e1679..a7ada9eed706 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#4a61536649cbfe49236a35bc7542b5dfd0767e4a", "expo": "^50.0.3", "expo-image": "1.10.1", + "expo-image-manipulator": "11.8.0", "fbjs": "^3.0.2", "htmlparser2": "^7.2.0", "idb-keyval": "^6.2.1", diff --git a/src/components/AvatarCropModal/AvatarCropModal.tsx b/src/components/AvatarCropModal/AvatarCropModal.tsx index dd6d41f4b227..04b3fabf3c29 100644 --- a/src/components/AvatarCropModal/AvatarCropModal.tsx +++ b/src/components/AvatarCropModal/AvatarCropModal.tsx @@ -20,7 +20,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import cropOrRotateImage from '@libs/cropOrRotateImage'; -import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage'; import CONST from '@src/CONST'; import type IconAsset from '@src/types/utils/IconAsset'; import ImageCropView from './ImageCropView'; @@ -291,7 +291,6 @@ function AvatarCropModal({imageUri = '', imageName = '', imageType = '', onClose const isSvg = imageType.includes('image/svg'); const name = isSvg ? 'fileName.png' : imageName; const type = isSvg ? 'image/png' : imageType; - cropOrRotateImage(imageUri, [{rotate: rotation.value % 360}, {crop}], {compress: 1, name, type}) .then((newImage) => { onClose?.(); diff --git a/src/libs/API/parameters/UpdateUserAvatarParams.ts b/src/libs/API/parameters/UpdateUserAvatarParams.ts index 2dce38e8763c..67c874ee350f 100644 --- a/src/libs/API/parameters/UpdateUserAvatarParams.ts +++ b/src/libs/API/parameters/UpdateUserAvatarParams.ts @@ -1,4 +1,4 @@ -import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage'; type UpdateUserAvatarParams = { file: File | CustomRNImageManipulatorResult; diff --git a/src/libs/actions/PersonalDetails.ts b/src/libs/actions/PersonalDetails.ts index 26c8937de3aa..c422c0d30828 100644 --- a/src/libs/actions/PersonalDetails.ts +++ b/src/libs/actions/PersonalDetails.ts @@ -13,7 +13,7 @@ import type { UpdateUserAvatarParams, } from '@libs/API/parameters'; import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; -import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage'; import DateUtils from '@libs/DateUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; diff --git a/src/libs/cropOrRotateImage.ts b/src/libs/cropOrRotateImage.ts new file mode 100644 index 000000000000..5562272f91c6 --- /dev/null +++ b/src/libs/cropOrRotateImage.ts @@ -0,0 +1,57 @@ +import {manipulateAsync, SaveFormat} from 'expo-image-manipulator'; +import type {ImageResult} from 'expo-image-manipulator'; + +type CropOrRotateImageOptions = { + type: string; + name: string; + compress: number; +}; + +type CropAction = { + crop: { + originX: number; + originY: number; + width: number; + height: number; + }; +}; + +type RotateOption = {rotate: number}; + +type Action = CropAction | RotateOption; + +type CustomRNImageManipulatorResult = ImageResult & {size: number; type: string; name: string}; + +type CropOrRotateImage = (uri: string, actions: Action[], options: CropOrRotateImageOptions) => Promise; + +function getSaveFormat(type: string) { + switch (type) { + case 'image/png': + return SaveFormat.PNG; + case 'image/webp': + return SaveFormat.WEBP; + case 'image/jpeg': + return SaveFormat.JPEG; + default: + return SaveFormat.JPEG; + } +} +/** + * Crops and rotates the image on ios/android + */ +const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => + new Promise((resolve) => { + const format = getSaveFormat(options.type); + manipulateAsync(uri, actions, {compress: options.compress, format}).then((result) => { + fetch(result.uri) + .then((res) => res.blob()) + .then((blob) => { + const file = new File([blob], options.name || 'fileName.jpeg', {type: options.type || 'image/jpeg'}); + file.uri = URL.createObjectURL(file); + resolve(file); + }); + }); + }); + +export default cropOrRotateImage; +export type {CustomRNImageManipulatorResult}; diff --git a/src/libs/cropOrRotateImage/index.native.ts b/src/libs/cropOrRotateImage/index.native.ts deleted file mode 100644 index c3fed59ba4fa..000000000000 --- a/src/libs/cropOrRotateImage/index.native.ts +++ /dev/null @@ -1,22 +0,0 @@ -import RNImageManipulator from '@oguzhnatly/react-native-image-manipulator'; -import RNFetchBlob from 'react-native-blob-util'; -import type {CropOrRotateImage} from './types'; - -/** - * Crops and rotates the image on ios/android - */ -const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => - new Promise((resolve) => { - RNImageManipulator.manipulate(uri, actions, options).then((result) => { - RNFetchBlob.fs.stat(result.uri.replace('file://', '')).then(({size}) => { - resolve({ - ...result, - size, - type: options.type || 'image/jpeg', - name: options.name || 'fileName.jpg', - }); - }); - }); - }); - -export default cropOrRotateImage; diff --git a/src/libs/cropOrRotateImage/index.ts b/src/libs/cropOrRotateImage/index.ts deleted file mode 100644 index ea3d51a465ec..000000000000 --- a/src/libs/cropOrRotateImage/index.ts +++ /dev/null @@ -1,127 +0,0 @@ -import type {CropOptions, CropOrRotateImage, CropOrRotateImageOptions} from './types'; - -type SizeFromAngle = { - width: number; - height: number; -}; - -/** - * Calculates a size of canvas after rotation - */ -function sizeFromAngle(width: number, height: number, angle: number): SizeFromAngle { - const radians = (angle * Math.PI) / 180; - let sine = Math.cos(radians); - let cosine = Math.sin(radians); - if (cosine < 0) { - cosine = -cosine; - } - if (sine < 0) { - sine = -sine; - } - return {width: height * cosine + width * sine, height: height * sine + width * cosine}; -} - -/** - * Creates a new rotated canvas - */ -function rotateCanvas(canvas: HTMLCanvasElement, degrees: number): HTMLCanvasElement { - const {width, height} = sizeFromAngle(canvas.width, canvas.height, degrees); - - // We have to create a new canvas because it is not possible to change already drawn - // elements. Transformations such as rotation have to be applied before drawing - const result = document.createElement('canvas'); - result.width = width; - result.height = height; - - const context = result.getContext('2d'); - if (context) { - // In order to rotate image along its center we have to apply next transformation - context.translate(result.width / 2, result.height / 2); - - const radians = (degrees * Math.PI) / 180; - context.rotate(radians); - - context.drawImage(canvas, -canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height); - } - return result; -} - -/** - * Creates new cropped canvas and returns it - */ -function cropCanvas(canvas: HTMLCanvasElement, options: CropOptions) { - let {originX = 0, originY = 0, width = 0, height = 0} = options; - const clamp = (value: number, max: number) => Math.max(0, Math.min(max, value)); - - width = clamp(width, canvas.width); - height = clamp(height, canvas.height); - originX = clamp(originX, canvas.width); - originY = clamp(originY, canvas.height); - - width = Math.min(originX + width, canvas.width) - originX; - height = Math.min(originY + height, canvas.height) - originY; - - const result = document.createElement('canvas'); - result.width = width; - result.height = height; - - const context = result.getContext('2d'); - context?.drawImage(canvas, originX, originY, width, height, 0, 0, width, height); - - return result; -} - -function convertCanvasToFile(canvas: HTMLCanvasElement, options: CropOrRotateImageOptions): Promise { - return new Promise((resolve) => { - canvas.toBlob((blob) => { - if (!blob) { - return; - } - const file = new File([blob], options.name || 'fileName.jpeg', {type: options.type || 'image/jpeg'}); - file.uri = URL.createObjectURL(file); - resolve(file); - }); - }); -} - -/** - * Loads image from specified url - */ -function loadImageAsync(uri: string): Promise { - return new Promise((resolve, reject) => { - const imageSource = new Image(); - imageSource.crossOrigin = 'anonymous'; - const canvas = document.createElement('canvas'); - imageSource.onload = () => { - canvas.width = imageSource.naturalWidth; - canvas.height = imageSource.naturalHeight; - - const context = canvas.getContext('2d'); - context?.drawImage(imageSource, 0, 0, imageSource.naturalWidth, imageSource.naturalHeight); - - resolve(canvas); - }; - imageSource.onerror = () => reject(canvas); - imageSource.src = uri; - }); -} - -/** - * Crops and rotates the image on web - */ - -const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => - loadImageAsync(uri).then((originalCanvas) => { - const resultCanvas = actions.reduce((canvas, action) => { - if (action.crop) { - return cropCanvas(canvas, action.crop); - } - if (action.rotate) { - return rotateCanvas(canvas, action.rotate); - } - return canvas; - }, originalCanvas); - return convertCanvasToFile(resultCanvas, options); - }); - -export default cropOrRotateImage; diff --git a/src/libs/cropOrRotateImage/types.ts b/src/libs/cropOrRotateImage/types.ts deleted file mode 100644 index f882e4f9bea2..000000000000 --- a/src/libs/cropOrRotateImage/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type {RNImageManipulatorResult} from '@oguzhnatly/react-native-image-manipulator'; - -type CropOrRotateImageOptions = { - type: string; - name: string; - compress: number; -}; - -type CropOptions = { - originX: number; - originY: number; - width: number; - height: number; -}; - -type Action = { - crop?: CropOptions; - rotate?: number; -}; - -type CustomRNImageManipulatorResult = RNImageManipulatorResult & {size: number; type: string; name: string}; - -type CropOrRotateImage = (uri: string, actions: Action[], options: CropOrRotateImageOptions) => Promise; - -export type {CropOrRotateImage, CropOptions, Action, CropOrRotateImageOptions, CustomRNImageManipulatorResult}; From d10d09d88a3eab6aa35a8d80c3e065dcf59dab68 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Wed, 7 Feb 2024 14:28:54 +0100 Subject: [PATCH 02/12] Remove unused dependency --- ios/Podfile.lock | 6 ------ package-lock.json | 7 ------- package.json | 1 - ...react-native-image-manipulator+1.0.5.patch | 19 ------------------- 4 files changed, 33 deletions(-) delete mode 100644 patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e2a351df1c4a..a49e22626962 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1176,8 +1176,6 @@ PODS: - React-Core - react-native-geolocation (3.0.6): - React-Core - - react-native-image-manipulator (1.0.5): - - React - react-native-image-picker (5.1.0): - React-Core - react-native-key-command (1.0.6): @@ -1533,7 +1531,6 @@ DEPENDENCIES: - react-native-config (from `../node_modules/react-native-config`) - react-native-document-picker (from `../node_modules/react-native-document-picker`) - "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)" - - "react-native-image-manipulator (from `../node_modules/@oguzhnatly/react-native-image-manipulator`)" - react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-key-command (from `../node_modules/react-native-key-command`) - react-native-launch-arguments (from `../node_modules/react-native-launch-arguments`) @@ -1729,8 +1726,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-document-picker" react-native-geolocation: :path: "../node_modules/@react-native-community/geolocation" - react-native-image-manipulator: - :path: "../node_modules/@oguzhnatly/react-native-image-manipulator" react-native-image-picker: :path: "../node_modules/react-native-image-picker" react-native-key-command: @@ -1932,7 +1927,6 @@ SPEC CHECKSUMS: react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e react-native-document-picker: 69ca2094d8780cfc1e7e613894d15290fdc54bba react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903 - react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56 react-native-image-picker: c33d4e79f0a14a2b66e5065e14946ae63749660b react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d diff --git a/package-lock.json b/package-lock.json index 3918ba2acfca..5c29c0e727e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "@invertase/react-native-apple-authentication": "^2.2.2", "@kie/act-js": "^2.6.0", "@kie/mock-github": "^1.0.0", - "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "8.3.0", "@react-native-async-storage/async-storage": "1.21.0", "@react-native-camera-roll/camera-roll": "5.4.0", @@ -7938,12 +7937,6 @@ "@octokit/openapi-types": "^12.11.0" } }, - "node_modules/@oguzhnatly/react-native-image-manipulator": { - "version": "1.0.5", - "resolved": "git+ssh://git@github.com/Expensify/react-native-image-manipulator.git#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", - "integrity": "sha512-C9Br1BQqm6io6lvYHptlLcOHbzlaqxp9tS35P8Qj3pdiiYRTzU3KPvZ61rQ+ZnZ4FOQ6MwPsKsmB8+6WHkAY6Q==", - "license": "MIT" - }, "node_modules/@onfido/active-video-capture": { "version": "0.28.6", "resolved": "https://registry.npmjs.org/@onfido/active-video-capture/-/active-video-capture-0.28.6.tgz", diff --git a/package.json b/package.json index a7ada9eed706..d8cb30671113 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "@invertase/react-native-apple-authentication": "^2.2.2", "@kie/act-js": "^2.6.0", "@kie/mock-github": "^1.0.0", - "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "8.3.0", "@react-native-async-storage/async-storage": "1.21.0", "@react-native-camera-roll/camera-roll": "5.4.0", diff --git a/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch b/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch deleted file mode 100644 index d5a390daf201..000000000000 --- a/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/node_modules/@oguzhnatly/react-native-image-manipulator/android/build.gradle b/node_modules/@oguzhnatly/react-native-image-manipulator/android/build.gradle -index 3a1a548..fe030bb 100644 ---- a/node_modules/@oguzhnatly/react-native-image-manipulator/android/build.gradle -+++ b/node_modules/@oguzhnatly/react-native-image-manipulator/android/build.gradle -@@ -13,12 +13,12 @@ buildscript { - apply plugin: 'com.android.library' - - android { -- compileSdkVersion 28 -+ compileSdkVersion 34 - buildToolsVersion "28.0.3" - - defaultConfig { - minSdkVersion 16 -- targetSdkVersion 28 -+ targetSdkVersion 34 - versionCode 1 - versionName "1.0" - } From 21cf30e293c9cacb5b7efbb8b542f6ec38db6c71 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Thu, 8 Feb 2024 12:20:43 +0100 Subject: [PATCH 03/12] Fixes for fabric --- src/libs/cropOrRotateImage.ts | 57 ---------------------- src/libs/cropOrRotateImage/index.native.ts | 24 +++++++++ src/libs/cropOrRotateImage/index.ts | 19 ++++++++ src/libs/cropOrRotateImage/types.ts | 26 ++++++++++ src/libs/cropOrRotateImage/utils.ts | 16 ++++++ 5 files changed, 85 insertions(+), 57 deletions(-) delete mode 100644 src/libs/cropOrRotateImage.ts create mode 100644 src/libs/cropOrRotateImage/index.native.ts create mode 100644 src/libs/cropOrRotateImage/index.ts create mode 100644 src/libs/cropOrRotateImage/types.ts create mode 100644 src/libs/cropOrRotateImage/utils.ts diff --git a/src/libs/cropOrRotateImage.ts b/src/libs/cropOrRotateImage.ts deleted file mode 100644 index 5562272f91c6..000000000000 --- a/src/libs/cropOrRotateImage.ts +++ /dev/null @@ -1,57 +0,0 @@ -import {manipulateAsync, SaveFormat} from 'expo-image-manipulator'; -import type {ImageResult} from 'expo-image-manipulator'; - -type CropOrRotateImageOptions = { - type: string; - name: string; - compress: number; -}; - -type CropAction = { - crop: { - originX: number; - originY: number; - width: number; - height: number; - }; -}; - -type RotateOption = {rotate: number}; - -type Action = CropAction | RotateOption; - -type CustomRNImageManipulatorResult = ImageResult & {size: number; type: string; name: string}; - -type CropOrRotateImage = (uri: string, actions: Action[], options: CropOrRotateImageOptions) => Promise; - -function getSaveFormat(type: string) { - switch (type) { - case 'image/png': - return SaveFormat.PNG; - case 'image/webp': - return SaveFormat.WEBP; - case 'image/jpeg': - return SaveFormat.JPEG; - default: - return SaveFormat.JPEG; - } -} -/** - * Crops and rotates the image on ios/android - */ -const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => - new Promise((resolve) => { - const format = getSaveFormat(options.type); - manipulateAsync(uri, actions, {compress: options.compress, format}).then((result) => { - fetch(result.uri) - .then((res) => res.blob()) - .then((blob) => { - const file = new File([blob], options.name || 'fileName.jpeg', {type: options.type || 'image/jpeg'}); - file.uri = URL.createObjectURL(file); - resolve(file); - }); - }); - }); - -export default cropOrRotateImage; -export type {CustomRNImageManipulatorResult}; diff --git a/src/libs/cropOrRotateImage/index.native.ts b/src/libs/cropOrRotateImage/index.native.ts new file mode 100644 index 000000000000..2647c3e218f7 --- /dev/null +++ b/src/libs/cropOrRotateImage/index.native.ts @@ -0,0 +1,24 @@ +import {manipulateAsync} from 'expo-image-manipulator'; +import RNFetchBlob from 'react-native-blob-util'; +import type CropOrRotateImage from './types'; +import getSaveFormat from './utils'; + +/** + * Crops and rotates the image on ios/android + */ +const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => + new Promise((resolve) => { + const format = getSaveFormat(options.type); + manipulateAsync(uri, actions, {compress: options.compress, format}).then((result) => { + RNFetchBlob.fs.stat(result.uri.replace('file://', '')).then(({size}) => { + resolve({ + ...result, + size, + type: options.type || 'image/jpeg', + name: options.name || 'fileName.jpg', + }); + }); + }); + }); + +export default cropOrRotateImage; diff --git a/src/libs/cropOrRotateImage/index.ts b/src/libs/cropOrRotateImage/index.ts new file mode 100644 index 000000000000..90fc0d7c7812 --- /dev/null +++ b/src/libs/cropOrRotateImage/index.ts @@ -0,0 +1,19 @@ +import {manipulateAsync} from 'expo-image-manipulator'; +import type CropOrRotateImage from './types'; +import getSaveFormat from './utils'; + +const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => + new Promise((resolve) => { + const format = getSaveFormat(options.type); + manipulateAsync(uri, actions, {compress: options.compress, format}).then((result) => { + fetch(result.uri) + .then((res) => res.blob()) + .then((blob) => { + const file = new File([blob], options.name || 'fileName.jpeg', {type: options.type || 'image/jpeg'}); + file.uri = URL.createObjectURL(file); + resolve(file); + }); + }); + }); + +export default cropOrRotateImage; diff --git a/src/libs/cropOrRotateImage/types.ts b/src/libs/cropOrRotateImage/types.ts new file mode 100644 index 000000000000..ea6f025ce16e --- /dev/null +++ b/src/libs/cropOrRotateImage/types.ts @@ -0,0 +1,26 @@ +import type {ImageResult} from 'expo-image-manipulator'; + +type CropOrRotateImageOptions = { + type: string; + name: string; + compress: number; +}; + +type CropAction = { + crop: { + originX: number; + originY: number; + width: number; + height: number; + }; +}; + +type RotateOption = {rotate: number}; + +type Action = CropAction | RotateOption; + +type CustomRNImageManipulatorResult = ImageResult & {size: number; type: string; name: string}; + +type CropOrRotateImage = (uri: string, actions: Action[], options: CropOrRotateImageOptions) => Promise; + +export default CropOrRotateImage; diff --git a/src/libs/cropOrRotateImage/utils.ts b/src/libs/cropOrRotateImage/utils.ts new file mode 100644 index 000000000000..bd3f941be77d --- /dev/null +++ b/src/libs/cropOrRotateImage/utils.ts @@ -0,0 +1,16 @@ +import {SaveFormat} from 'expo-image-manipulator'; + +function getSaveFormat(type: string) { + switch (type) { + case 'image/png': + return SaveFormat.PNG; + case 'image/webp': + return SaveFormat.WEBP; + case 'image/jpeg': + return SaveFormat.JPEG; + default: + return SaveFormat.JPEG; + } +} + +export default getSaveFormat; From f8a4f8106c41a9d0f1101f1e9673c521b3dc7375 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Mon, 19 Feb 2024 12:59:21 +0100 Subject: [PATCH 04/12] Cleanup Podfile.lock --- ios/Podfile.lock | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a631f3e62495..b26aafb999a0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1181,8 +1181,6 @@ PODS: - React-Core - react-native-geolocation (3.0.6): - React-Core - - react-native-image-manipulator (1.0.5): - - React - react-native-image-picker (7.0.3): - React-Core - react-native-key-command (1.0.6): @@ -1946,11 +1944,9 @@ SPEC CHECKSUMS: react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452 react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903 - react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56 react-native-image-picker: 2381c008bbb09e72395a2d043c147b11bd1523d9 react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d - react-native-live-markdown: 1ca4275d4dba8eebb736a005148f24a8224f54d9 react-native-netinfo: 8a7fd3f7130ef4ad2fb4276d5c9f8d3f28d2df3d react-native-pager-view: 02a5c4962530f7efc10dd51ee9cdabeff5e6c631 react-native-pdf: b4ca3d37a9a86d9165287741c8b2ef4d8940c00e @@ -2011,7 +2007,7 @@ SPEC CHECKSUMS: SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2 VisionCamera: 0a6794d1974aed5d653d0d0cb900493e2583e35a - Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 + Yoga: 13c8ef87792450193e117976337b8527b49e8c03 PODFILE CHECKSUM: 0ccbb4f2406893c6e9f266dc1e7470dcd72885d2 From 63d39c400b4317fed3c74f8c8098f1bdd5d582dd Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Mon, 19 Feb 2024 17:00:55 +0100 Subject: [PATCH 05/12] Fix TS issues --- src/components/AvatarCropModal/AvatarCropModal.tsx | 2 +- src/libs/API/parameters/UpdateUserAvatarParams.ts | 2 +- src/libs/actions/PersonalDetails.ts | 2 +- src/libs/cropOrRotateImage/index.native.ts | 2 +- src/libs/cropOrRotateImage/index.ts | 2 +- src/libs/cropOrRotateImage/types.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/AvatarCropModal/AvatarCropModal.tsx b/src/components/AvatarCropModal/AvatarCropModal.tsx index 04b3fabf3c29..ddf3640b7206 100644 --- a/src/components/AvatarCropModal/AvatarCropModal.tsx +++ b/src/components/AvatarCropModal/AvatarCropModal.tsx @@ -20,7 +20,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import cropOrRotateImage from '@libs/cropOrRotateImage'; -import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; import CONST from '@src/CONST'; import type IconAsset from '@src/types/utils/IconAsset'; import ImageCropView from './ImageCropView'; diff --git a/src/libs/API/parameters/UpdateUserAvatarParams.ts b/src/libs/API/parameters/UpdateUserAvatarParams.ts index 67c874ee350f..2dce38e8763c 100644 --- a/src/libs/API/parameters/UpdateUserAvatarParams.ts +++ b/src/libs/API/parameters/UpdateUserAvatarParams.ts @@ -1,4 +1,4 @@ -import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; type UpdateUserAvatarParams = { file: File | CustomRNImageManipulatorResult; diff --git a/src/libs/actions/PersonalDetails.ts b/src/libs/actions/PersonalDetails.ts index fff3f31d1116..5ae37bb85f10 100644 --- a/src/libs/actions/PersonalDetails.ts +++ b/src/libs/actions/PersonalDetails.ts @@ -13,7 +13,7 @@ import type { UpdateUserAvatarParams, } from '@libs/API/parameters'; import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; -import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; import DateUtils from '@libs/DateUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; diff --git a/src/libs/cropOrRotateImage/index.native.ts b/src/libs/cropOrRotateImage/index.native.ts index 2647c3e218f7..f6bdcb9c50cb 100644 --- a/src/libs/cropOrRotateImage/index.native.ts +++ b/src/libs/cropOrRotateImage/index.native.ts @@ -1,6 +1,6 @@ import {manipulateAsync} from 'expo-image-manipulator'; import RNFetchBlob from 'react-native-blob-util'; -import type CropOrRotateImage from './types'; +import type {CropOrRotateImage} from './types'; import getSaveFormat from './utils'; /** diff --git a/src/libs/cropOrRotateImage/index.ts b/src/libs/cropOrRotateImage/index.ts index 90fc0d7c7812..e87cba43e43d 100644 --- a/src/libs/cropOrRotateImage/index.ts +++ b/src/libs/cropOrRotateImage/index.ts @@ -1,5 +1,5 @@ import {manipulateAsync} from 'expo-image-manipulator'; -import type CropOrRotateImage from './types'; +import type {CropOrRotateImage} from './types'; import getSaveFormat from './utils'; const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => diff --git a/src/libs/cropOrRotateImage/types.ts b/src/libs/cropOrRotateImage/types.ts index ea6f025ce16e..9d9b9ff98080 100644 --- a/src/libs/cropOrRotateImage/types.ts +++ b/src/libs/cropOrRotateImage/types.ts @@ -23,4 +23,4 @@ type CustomRNImageManipulatorResult = ImageResult & {size: number; type: string; type CropOrRotateImage = (uri: string, actions: Action[], options: CropOrRotateImageOptions) => Promise; -export default CropOrRotateImage; +export type {CustomRNImageManipulatorResult, CropOrRotateImage}; From 1682cdb811c3a6f7c09b96dbaee4c41ff2d99818 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Tue, 20 Feb 2024 11:23:31 +0100 Subject: [PATCH 06/12] Code review changes --- src/CONST.ts | 6 ++++++ src/libs/cropOrRotateImage/{utils.ts => getSaveFormat.ts} | 7 ++++--- src/libs/cropOrRotateImage/index.native.ts | 2 +- src/libs/cropOrRotateImage/index.ts | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) rename src/libs/cropOrRotateImage/{utils.ts => getSaveFormat.ts} (68%) diff --git a/src/CONST.ts b/src/CONST.ts index df0e1ad1c4ee..08abb4953a45 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1008,6 +1008,12 @@ const CONST = { VIDEO: 'video', }, + FILE_FORMAT: { + PNG: 'image/png', + WEBP: 'image/webp', + JPEG: 'image/jpeg', + }, + FILE_TYPE_REGEX: { // Image MimeTypes allowed by iOS photos app. IMAGE: /\.(jpg|jpeg|png|webp|gif|tiff|bmp|heic|heif)$/, diff --git a/src/libs/cropOrRotateImage/utils.ts b/src/libs/cropOrRotateImage/getSaveFormat.ts similarity index 68% rename from src/libs/cropOrRotateImage/utils.ts rename to src/libs/cropOrRotateImage/getSaveFormat.ts index bd3f941be77d..5a0ff6dd9032 100644 --- a/src/libs/cropOrRotateImage/utils.ts +++ b/src/libs/cropOrRotateImage/getSaveFormat.ts @@ -1,12 +1,13 @@ import {SaveFormat} from 'expo-image-manipulator'; +import CONST from '@src/CONST'; function getSaveFormat(type: string) { switch (type) { - case 'image/png': + case CONST.FILE_FORMAT.PNG: return SaveFormat.PNG; - case 'image/webp': + case CONST.FILE_FORMAT.WEBP: return SaveFormat.WEBP; - case 'image/jpeg': + case CONST.FILE_FORMAT.JPEG: return SaveFormat.JPEG; default: return SaveFormat.JPEG; diff --git a/src/libs/cropOrRotateImage/index.native.ts b/src/libs/cropOrRotateImage/index.native.ts index f6bdcb9c50cb..25d56598e5d2 100644 --- a/src/libs/cropOrRotateImage/index.native.ts +++ b/src/libs/cropOrRotateImage/index.native.ts @@ -1,7 +1,7 @@ import {manipulateAsync} from 'expo-image-manipulator'; import RNFetchBlob from 'react-native-blob-util'; +import getSaveFormat from 'src/libs/cropOrRotateImage/getSaveFormat'; import type {CropOrRotateImage} from './types'; -import getSaveFormat from './utils'; /** * Crops and rotates the image on ios/android diff --git a/src/libs/cropOrRotateImage/index.ts b/src/libs/cropOrRotateImage/index.ts index e87cba43e43d..4cbd6fafcfe5 100644 --- a/src/libs/cropOrRotateImage/index.ts +++ b/src/libs/cropOrRotateImage/index.ts @@ -1,6 +1,6 @@ import {manipulateAsync} from 'expo-image-manipulator'; +import getSaveFormat from 'src/libs/cropOrRotateImage/getSaveFormat'; import type {CropOrRotateImage} from './types'; -import getSaveFormat from './utils'; const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => new Promise((resolve) => { From 0e48707f93f92f4e47100f2f71b3c41bc538dbe1 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Tue, 20 Feb 2024 14:22:09 +0100 Subject: [PATCH 07/12] Code review change --- src/CONST.ts | 2 +- src/libs/cropOrRotateImage/getSaveFormat.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 08abb4953a45..9bb1658a756f 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1008,7 +1008,7 @@ const CONST = { VIDEO: 'video', }, - FILE_FORMAT: { + IMAGE_FILE_FORMAT: { PNG: 'image/png', WEBP: 'image/webp', JPEG: 'image/jpeg', diff --git a/src/libs/cropOrRotateImage/getSaveFormat.ts b/src/libs/cropOrRotateImage/getSaveFormat.ts index 5a0ff6dd9032..6d1ff280c5c5 100644 --- a/src/libs/cropOrRotateImage/getSaveFormat.ts +++ b/src/libs/cropOrRotateImage/getSaveFormat.ts @@ -3,11 +3,11 @@ import CONST from '@src/CONST'; function getSaveFormat(type: string) { switch (type) { - case CONST.FILE_FORMAT.PNG: + case CONST.IMAGE_FILE_FORMAT.PNG: return SaveFormat.PNG; - case CONST.FILE_FORMAT.WEBP: + case CONST.IMAGE_FILE_FORMAT.WEBP: return SaveFormat.WEBP; - case CONST.FILE_FORMAT.JPEG: + case CONST.IMAGE_FILE_FORMAT.JPEG: return SaveFormat.JPEG; default: return SaveFormat.JPEG; From caf4552358d109be8793213d3cc5272bb6d6899f Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:45:04 +0100 Subject: [PATCH 08/12] fix imports --- src/libs/cropOrRotateImage/index.native.ts | 2 +- src/libs/cropOrRotateImage/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/cropOrRotateImage/index.native.ts b/src/libs/cropOrRotateImage/index.native.ts index 25d56598e5d2..03c233450435 100644 --- a/src/libs/cropOrRotateImage/index.native.ts +++ b/src/libs/cropOrRotateImage/index.native.ts @@ -1,6 +1,6 @@ import {manipulateAsync} from 'expo-image-manipulator'; import RNFetchBlob from 'react-native-blob-util'; -import getSaveFormat from 'src/libs/cropOrRotateImage/getSaveFormat'; +import getSaveFormat from './getSaveFormat'; import type {CropOrRotateImage} from './types'; /** diff --git a/src/libs/cropOrRotateImage/index.ts b/src/libs/cropOrRotateImage/index.ts index 4cbd6fafcfe5..1b669999a1ee 100644 --- a/src/libs/cropOrRotateImage/index.ts +++ b/src/libs/cropOrRotateImage/index.ts @@ -1,5 +1,5 @@ import {manipulateAsync} from 'expo-image-manipulator'; -import getSaveFormat from 'src/libs/cropOrRotateImage/getSaveFormat'; +import getSaveFormat from './getSaveFormat'; import type {CropOrRotateImage} from './types'; const cropOrRotateImage: CropOrRotateImage = (uri, actions, options) => From bb666cc6c0e1ee6742a26b7543fb1cbb093fcc4f Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:13:55 +0100 Subject: [PATCH 09/12] fix podfile --- ios/Podfile.lock | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 626cc2fafe69..3c19e07a4c5e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1179,6 +1179,8 @@ PODS: - React-Core - react-native-geolocation (3.0.6): - React-Core + - react-native-image-manipulator (1.0.5): + - React - react-native-image-picker (7.0.3): - React-Core - react-native-key-command (1.0.6): @@ -1540,6 +1542,7 @@ DEPENDENCIES: - react-native-config (from `../node_modules/react-native-config`) - react-native-document-picker (from `../node_modules/react-native-document-picker`) - "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)" + - "react-native-image-manipulator (from `../node_modules/@oguzhnatly/react-native-image-manipulator`)" - react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-key-command (from `../node_modules/react-native-key-command`) - react-native-launch-arguments (from `../node_modules/react-native-launch-arguments`) @@ -1738,6 +1741,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-document-picker" react-native-geolocation: :path: "../node_modules/@react-native-community/geolocation" + react-native-image-manipulator: + :path: "../node_modules/@oguzhnatly/react-native-image-manipulator" react-native-image-picker: :path: "../node_modules/react-native-image-picker" react-native-key-command: @@ -1942,6 +1947,7 @@ SPEC CHECKSUMS: react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452 react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903 + react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56 react-native-image-picker: 2381c008bbb09e72395a2d043c147b11bd1523d9 react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d From 8618c30db876e1397915a9c3d6b229f40e0e03f8 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:01:18 +0100 Subject: [PATCH 10/12] add removed line --- src/components/AvatarCropModal/AvatarCropModal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/AvatarCropModal/AvatarCropModal.tsx b/src/components/AvatarCropModal/AvatarCropModal.tsx index ddf3640b7206..dd6d41f4b227 100644 --- a/src/components/AvatarCropModal/AvatarCropModal.tsx +++ b/src/components/AvatarCropModal/AvatarCropModal.tsx @@ -291,6 +291,7 @@ function AvatarCropModal({imageUri = '', imageName = '', imageType = '', onClose const isSvg = imageType.includes('image/svg'); const name = isSvg ? 'fileName.png' : imageName; const type = isSvg ? 'image/png' : imageType; + cropOrRotateImage(imageUri, [{rotate: rotation.value % 360}, {crop}], {compress: 1, name, type}) .then((newImage) => { onClose?.(); From 8e57fb5d335c2fbcb8c2db5f23e955ef0120578b Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:44:56 +0100 Subject: [PATCH 11/12] fix package.json --- package-lock.json | 7 ------- package.json | 1 - 2 files changed, 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2dfbd7530849..e05f102f48b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "@invertase/react-native-apple-authentication": "^2.2.2", "@kie/act-js": "^2.6.0", "@kie/mock-github": "^1.0.0", - "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "10.6.0", "@react-native-async-storage/async-storage": "1.21.0", "@react-native-camera-roll/camera-roll": "5.4.0", @@ -8049,12 +8048,6 @@ "@octokit/openapi-types": "^12.11.0" } }, - "node_modules/@oguzhnatly/react-native-image-manipulator": { - "version": "1.0.5", - "resolved": "git+ssh://git@github.com/Expensify/react-native-image-manipulator.git#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", - "integrity": "sha512-MQJCP+Lkod1UA0yUk8JWpMexSXA0s7Kb3BRpz90mKli7ZCYXxz0cs9Ogg9rfqK2qmzUSjAOnCR0sCldYjNkDTw==", - "license": "MIT" - }, "node_modules/@onfido/active-video-capture": { "version": "0.28.6", "resolved": "https://registry.npmjs.org/@onfido/active-video-capture/-/active-video-capture-0.28.6.tgz", diff --git a/package.json b/package.json index 786c3ff0559e..45bb9e3e77df 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "@invertase/react-native-apple-authentication": "^2.2.2", "@kie/act-js": "^2.6.0", "@kie/mock-github": "^1.0.0", - "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "10.6.0", "@react-native-async-storage/async-storage": "1.21.0", "@react-native-camera-roll/camera-roll": "5.4.0", From f1860cd56af37d1eadb25b1acff3fc08ce96c7c7 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:46:01 +0100 Subject: [PATCH 12/12] podfile --- ios/Podfile.lock | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3c19e07a4c5e..626cc2fafe69 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1179,8 +1179,6 @@ PODS: - React-Core - react-native-geolocation (3.0.6): - React-Core - - react-native-image-manipulator (1.0.5): - - React - react-native-image-picker (7.0.3): - React-Core - react-native-key-command (1.0.6): @@ -1542,7 +1540,6 @@ DEPENDENCIES: - react-native-config (from `../node_modules/react-native-config`) - react-native-document-picker (from `../node_modules/react-native-document-picker`) - "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)" - - "react-native-image-manipulator (from `../node_modules/@oguzhnatly/react-native-image-manipulator`)" - react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-key-command (from `../node_modules/react-native-key-command`) - react-native-launch-arguments (from `../node_modules/react-native-launch-arguments`) @@ -1741,8 +1738,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-document-picker" react-native-geolocation: :path: "../node_modules/@react-native-community/geolocation" - react-native-image-manipulator: - :path: "../node_modules/@oguzhnatly/react-native-image-manipulator" react-native-image-picker: :path: "../node_modules/react-native-image-picker" react-native-key-command: @@ -1947,7 +1942,6 @@ SPEC CHECKSUMS: react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452 react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903 - react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56 react-native-image-picker: 2381c008bbb09e72395a2d043c147b11bd1523d9 react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d