|
| 1 | +diff --git a/node_modules/expo-image-manipulator/src/ImageManipulator.ts b/node_modules/expo-image-manipulator/src/ImageManipulator.ts |
| 2 | +index a80d9c8..babbb3b 100644 |
| 3 | +--- a/node_modules/expo-image-manipulator/src/ImageManipulator.ts |
| 4 | ++++ b/node_modules/expo-image-manipulator/src/ImageManipulator.ts |
| 5 | +@@ -43,7 +43,7 @@ export async function manipulateAsync( |
| 6 | + context.extent(action.extent); |
| 7 | + } |
| 8 | + } |
| 9 | +- const image = await context.renderAsync(); |
| 10 | ++ const image = await context.renderAsync(saveOptions.compress); |
| 11 | + const result = await image.saveAsync({ format, ...rest }); |
| 12 | + |
| 13 | + // These shared objects will not be used anymore, so free up some memory. |
| 14 | +diff --git a/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts b/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts |
| 15 | +index 120d8d3..f8aa49c 100644 |
| 16 | +--- a/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts |
| 17 | ++++ b/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts |
| 18 | +@@ -52,7 +52,7 @@ export declare class ImageManipulatorContext extends SharedObject { |
| 19 | + /** |
| 20 | + * Awaits for all manipulation tasks to finish and resolves with a reference to the resulted native image. |
| 21 | + */ |
| 22 | +- renderAsync(): Promise<ImageRef>; |
| 23 | ++ renderAsync(compress?: number): Promise<ImageRef>; |
| 24 | + } |
| 25 | + |
| 26 | + export default ExpoImageManipulator.Context as typeof ImageManipulatorContext; |
| 27 | +diff --git a/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts b/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts |
| 28 | +index 428848c..363a57a 100644 |
| 29 | +--- a/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts |
| 30 | ++++ b/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts |
| 31 | +@@ -41,7 +41,7 @@ export default class ImageManipulatorContext extends SharedObject { |
| 32 | + return this; |
| 33 | + } |
| 34 | + |
| 35 | +- async renderAsync(): Promise<ImageManipulatorImageRef> { |
| 36 | ++ async renderAsync(compress?: number): Promise<ImageManipulatorImageRef> { |
| 37 | + const canvas = await this.currentTask; |
| 38 | + |
| 39 | + return new Promise((resolve) => { |
| 40 | +@@ -49,7 +49,7 @@ export default class ImageManipulatorContext extends SharedObject { |
| 41 | + const url = blob ? URL.createObjectURL(blob) : canvas.toDataURL(); |
| 42 | + |
| 43 | + resolve(new ImageManipulatorImageRef(url, canvas.width, canvas.height)); |
| 44 | +- }); |
| 45 | ++ }, typeof compress === 'number' ? 'image/jpeg' : undefined, compress); |
| 46 | + }); |
| 47 | + } |
| 48 | + |
0 commit comments