diff --git a/packages/app-mobile/components/screens/Note.tsx b/packages/app-mobile/components/screens/Note.tsx index 33fca0f7dfd..0f83876dca1 100644 --- a/packages/app-mobile/components/screens/Note.tsx +++ b/packages/app-mobile/components/screens/Note.tsx @@ -36,7 +36,7 @@ const { BaseScreenComponent } = require('../base-screen.js'); const { themeStyle, editorFont } = require('../global-style.js'); const { dialogs } = require('../../utils/dialogs.js'); const DialogBox = require('react-native-dialogbox').default; -const ImageResizer = require('react-native-image-resizer').default; +import ImageResizer from '@bam.tech/react-native-image-resizer'; import shared from '@joplin/lib/components/shared/note-screen-shared'; import { ImagePickerResponse, launchImageLibrary } from 'react-native-image-picker'; import SelectDateTimeDialog from '../SelectDateTimeDialog'; @@ -586,7 +586,16 @@ class NoteScreenComponent extends BaseScreenComponent { const format = mimeType === 'image/png' ? 'PNG' : 'JPEG'; reg.logger().info(`Resizing image ${localFilePath}`); - const resizedImage = await ImageResizer.createResizedImage(localFilePath, dimensions.width, dimensions.height, format, 85); // , 0, targetPath); + const resizedImage = await ImageResizer.createResizedImage( + localFilePath, + dimensions.width, + dimensions.height, + format, + 85, // quality + undefined, // rotation + undefined, // outputPath + true // keep metadata + ); const resizedImagePath = resizedImage.uri; reg.logger().info('Resized image ', resizedImagePath); diff --git a/packages/app-mobile/ios/Podfile.lock b/packages/app-mobile/ios/Podfile.lock index 985ef747957..5c9599820ff 100644 --- a/packages/app-mobile/ios/Podfile.lock +++ b/packages/app-mobile/ios/Podfile.lock @@ -353,7 +353,7 @@ PODS: - React-Core - react-native-image-picker (5.6.0): - React-Core - - react-native-image-resizer (1.4.5): + - react-native-image-resizer (3.0.5): - React-Core - react-native-netinfo (9.4.1): - React-Core @@ -584,7 +584,7 @@ DEPENDENCIES: - "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)" - react-native-get-random-values (from `../node_modules/react-native-get-random-values`) - react-native-image-picker (from `../node_modules/react-native-image-picker`) - - react-native-image-resizer (from `../node_modules/react-native-image-resizer`) + - "react-native-image-resizer (from `../node_modules/@bam.tech/react-native-image-resizer`)" - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-rsa-native (from `../node_modules/react-native-rsa-native`) - "react-native-saf-x (from `../node_modules/@joplin/react-native-saf-x`)" @@ -703,7 +703,7 @@ EXTERNAL SOURCES: react-native-image-picker: :path: "../node_modules/react-native-image-picker" react-native-image-resizer: - :path: "../node_modules/react-native-image-resizer" + :path: "../node_modules/@bam.tech/react-native-image-resizer" react-native-netinfo: :path: "../node_modules/@react-native-community/netinfo" react-native-rsa-native: @@ -824,7 +824,7 @@ SPEC CHECKSUMS: react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903 react-native-get-random-values: dee677497c6a740b71e5612e8dbd83e7539ed5bb react-native-image-picker: db60857e03d63721f19b6f4027de20429ddd9cba - react-native-image-resizer: d9fb629a867335bdc13230ac2a58702bb8c8828f + react-native-image-resizer: 00ceb0e05586c7aadf061eea676957a6c2ec60fa react-native-netinfo: fefd4e98d75cbdd6e85fc530f7111a8afdf2b0c5 react-native-rsa-native: 12132eb627797529fdb1f0d22fd0f8f9678df64a react-native-saf-x: 129cd2ddf120a1f6164c724b2846d172666b33de diff --git a/packages/app-mobile/package.json b/packages/app-mobile/package.json index bbdff11dbe4..a5891859f52 100644 --- a/packages/app-mobile/package.json +++ b/packages/app-mobile/package.json @@ -18,6 +18,7 @@ "postinstall": "jetify && yarn run build" }, "dependencies": { + "@bam.tech/react-native-image-resizer": "3.0.5", "@joplin/lib": "~2.12", "@joplin/react-native-alarm-notification": "~2.12", "@joplin/react-native-saf-x": "~2.12", @@ -56,7 +57,6 @@ "react-native-gesture-handler": "2.12.0", "react-native-get-random-values": "1.9.0", "react-native-image-picker": "5.6.0", - "react-native-image-resizer": "1.4.5", "react-native-localize": "3.0.2", "react-native-modal-datetime-picker": "15.0.1", "react-native-paper": "5.9.1", diff --git a/yarn.lock b/yarn.lock index 0fdaf6bf9f6..94cdd9d6bf7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2840,6 +2840,16 @@ __metadata: languageName: node linkType: hard +"@bam.tech/react-native-image-resizer@npm:3.0.5": + version: 3.0.5 + resolution: "@bam.tech/react-native-image-resizer@npm:3.0.5" + peerDependencies: + react: "*" + react-native: "*" + checksum: f555bd10aafab1a797b6f5142e59b1bb11f229b61d35c3e6c9d734bbd4999f97bcc86853f69965d758ca872aad024add7a852041da498b177eee923ef82e506d + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -4502,6 +4512,7 @@ __metadata: "@babel/core": 7.20.2 "@babel/preset-env": 7.20.2 "@babel/runtime": 7.20.0 + "@bam.tech/react-native-image-resizer": 3.0.5 "@codemirror/commands": 6.2.2 "@codemirror/lang-cpp": 6.0.2 "@codemirror/lang-html": 6.4.3 @@ -4576,7 +4587,6 @@ __metadata: react-native-gesture-handler: 2.12.0 react-native-get-random-values: 1.9.0 react-native-image-picker: 5.6.0 - react-native-image-resizer: 1.4.5 react-native-localize: 3.0.2 react-native-modal-datetime-picker: 15.0.1 react-native-paper: 5.9.1 @@ -27912,15 +27922,6 @@ __metadata: languageName: node linkType: hard -"react-native-image-resizer@npm:1.4.5": - version: 1.4.5 - resolution: "react-native-image-resizer@npm:1.4.5" - peerDependencies: - react-native: ">=v0.40.0" - checksum: c530b119f25c27b669148461554440acd05fb37f0a24a1afc3d58c861e426551c70c679983c0399034fd54ca3575c89d0863778c49295721cb33b65bbf3f0f37 - languageName: node - linkType: hard - "react-native-localize@npm:3.0.2": version: 3.0.2 resolution: "react-native-localize@npm:3.0.2"