Skip to content

Commit 56bd91b

Browse files
committed
Add version 2.4.2
1 parent 4d16d7c commit 56bd91b

File tree

7 files changed

+38
-25
lines changed

7 files changed

+38
-25
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [2.4.2]
2+
3+
### Fixed
4+
5+
* [Android] Fixed serialization export file URL to include the schema.
6+
17
## [2.4.1]
28

39
### Fixed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
# React Native module for PhotoEditor SDK
1919

20+
Check out our [video tutorial](https://blog.photoeditorsdk.com/a-photo-and-video-editor-for-your-react-native-apps) for a step-by-step integration guide which also details advanced SDK features, such as serializing and reusing previously applied editing operations.
21+
2022
## Getting started
2123

2224
Install the React Native module in your project as follows:
@@ -81,11 +83,11 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
8183
}
8284
dependencies {
8385
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
84-
classpath 'ly.img.android.sdk:plugin:7.1.13'
86+
classpath 'ly.img.android.sdk:plugin:7.2.5'
8587
}
8688
}
8789
```
88-
In order to update PhotoEditor SDK for Android replace the version string `7.1.13` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
90+
In order to update PhotoEditor SDK for Android replace the version string `7.2.5` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
8991

9092
3. Configure PhotoEditor SDK for Android by opening the `android/app/build.gradle` file (**not** `android/build.gradle`) and adding the following lines under `apply plugin: "com.android.application"`:
9193
```groovy

android/src/main/java/ly/img/react_native/pesdk/RNPhotoEditorSDKModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class RNPhotoEditorSDKModule(val reactContext: ReactApplicationContext) : ReactC
8080
val file = serializationConfig.filename?.let { Export.convertPathToFile(it) }
8181
?: File.createTempFile("serialization", ".json")
8282
PESDKFileWriter(settingsList).writeJson(file)
83-
file.absolutePath
83+
Uri.fromFile(file).toString()
8484
}
8585
SerializationExportType.OBJECT -> {
8686
ReactJSON.convertJsonToMap(

index.d.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import { Component } from 'react';
22
import { Configuration } from './configuration';
33

4+
/**
5+
* The result of an export.
6+
*/
7+
interface PhotoEditorResult {
8+
/** The edited image. */
9+
image: string;
10+
/** An indicator whether the input image was modified at all. */
11+
hasChanges: boolean;
12+
/** All modifications applied to the input image if `export.serialization.enabled` of the `Configuration` was set to `true`. */
13+
serialization?: string | object;
14+
}
15+
416
declare class PESDK {
517
/**
618
* Modally present a photo editor.
@@ -17,17 +29,14 @@ declare class PESDK {
1729
* restores a previous state of the editor by re-applying all modifications to the loaded
1830
* image.
1931
*
20-
* @return {Promise<{image: string, hasChanges: boolean, serialization: object}>} Returns the
21-
* edited `image`, an indicator (`hasChanges`) whether the input image was modified at all, and
22-
* all modifications (`serialization`) applied to the input image if `export.serialization.enabled`
23-
* of the `configuration` was set. If the editor is dismissed without exporting the edited image
24-
* `null` is returned instead.
32+
* @return {Promise<PhotoEditorResult>} Returns a `PhotoEditorResult` or `null` if the editor
33+
* is dismissed without exporting the edited image.
2534
*/
2635
static openEditor(
2736
image: string | {uri: string} | number,
28-
configuration: Configuration,
29-
serialization: object
30-
): Promise<{image: string, hasChanges: boolean, serialization: object}>
37+
configuration?: Configuration,
38+
serialization?: object
39+
): Promise<PhotoEditorResult>
3140

3241
/**
3342
* Unlock PhotoEditor SDK with a license.
@@ -88,15 +97,11 @@ interface PhotoEditorModalProps {
8897

8998
/**
9099
* This prop determines the callback function that will be called when the user exported an image.
91-
*
92-
* The object passed to this callback includes the edited `image`, an indicator (`hasChanges`) whether
93-
* the input image was modified at all, and all modifications (`serialization`) applied to the input image
94-
* if `export.serialization.enabled` of the `configuration` prop was set.
95100
*/
96-
onExport: ({image: string, hasChanges: boolean, serialization: object}) => void;
101+
onExport: (args: PhotoEditorResult) => void;
97102

98103
/**
99-
* This prop determines the callback function that will be called when the user dissmisses the editor without
104+
* This prop determines the callback function that will be called when the user dismisses the editor without
100105
* exporting an image.
101106
*/
102107
onCancel?: () => void;

index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,8 @@ class PESDK {
103103
* restores a previous state of the editor by re-applying all modifications to the loaded
104104
* image.
105105
*
106-
* @return {Promise<{image: string, hasChanges: boolean, serialization: object}>} Returns the
107-
* edited `image`, an indicator (`hasChanges`) whether the input image was modified at all, and
108-
* all modifications (`serialization`) applied to the input image if `export.serialization.enabled`
109-
* of the `configuration` was set. If the editor is dismissed without exporting the edited image
110-
* `null` is returned instead.
106+
* @return {Promise<PhotoEditorResult>} Returns a `PhotoEditorResult` or `null` if the editor
107+
* is dismissed without exporting the edited image.
111108
*/
112109
static openEditor(image = null, configuration = null, serialization = null) {
113110
resolveStaticAssets(configuration)

ios/RNImglyKit.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ - (void)present:(nonnull IMGLYMediaEditViewControllerBlock)createMediaEditViewCo
3636
#if RN_IMGLY_DEBUG
3737
{
3838
// For release debugging
39-
NSURL *debugURL = [RCTConvert IMGLYExportFileURL:@"imgly-debug" withExpectedUTI:kUTTypeJSON];
39+
NSURL *debugURL = [RCTConvert RN_IMGLY_ExportFileURL:@"imgly-debug" withExpectedUTI:kUTTypeJSON];
4040
if (debugURL) {
4141
NSError *error = nil;
4242
NSJSONWritingOptions debugOptions = NSJSONWritingPrettyPrinted;
@@ -106,7 +106,10 @@ - (void)present:(nonnull IMGLYMediaEditViewControllerBlock)createMediaEditViewCo
106106

107107
// Update configuration
108108
NSMutableDictionary *updatedDictionary = [NSMutableDictionary dictionaryWithDictionary:dictionary];
109-
[updatedDictionary setValue:exportFile.absoluteString forKeyPath:@"export.filename"];
109+
NSMutableDictionary *exportDictionary = [NSMutableDictionary dictionaryWithDictionary:[NSDictionary RN_IMGLY_dictionary:updatedDictionary valueForKeyPath:@"export" default:@{}]];
110+
[exportDictionary setValue:exportFile.absoluteString forKeyPath:@"filename"];
111+
[updatedDictionary setValue:exportDictionary forKeyPath:@"export"];
112+
110113
configuration = [[PESDKConfiguration alloc] initWithBuilder:^(PESDKConfigurationBuilder * _Nonnull builder) {
111114
builder.assetCatalog = assetCatalog;
112115
[builder configureFromDictionary:updatedDictionary error:&error];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-photoeditorsdk",
33
"title": "React Native module for PhotoEditor SDK",
4-
"version": "2.4.1",
4+
"version": "2.4.2",
55
"description": "A React Native module for PhotoEditor SDK. Integrate the photo editor into your own HTML5, iOS or Android app - in minutes!",
66
"main": "index.js",
77
"typings": "index.d.ts",

0 commit comments

Comments
 (0)