Docs
API Docs

Migration from v7

1. Update the Plugin to v8

There are no compatibility changes on the Gradle Plugin itself, simply update the version.

// Add the PESDK repository and plugin dependency
buildscript {
    repositories {
        jcenter()
        google()
        maven { url 'https://artifactory.img.ly/artifactory/imgly' }
    }
    dependencies {
        // Insert the latest SDK version number here. You will find it here https://github.com/imgly/pesdk-android-demo/releases
        classpath 'ly.img.android.pesdk:plugin:8.0.2'
    }
}

2. Update your App for scoped storage.

Version 8 is now scoped storage compatible. See Storage updates in Android 11 for mor details.

You can and should remove the requestLegacyExternalStorage attribute from your AndroidManifest.xml. Make sure, that the rest of you app is ScopedStorage compatible, before you remove the flag!

3. Do not mix up SaveSettings

Use PhotoEditorSaveSettings to specify all your export settings and the export destination. SaveSettings are now an abstract class, you can use them to set the destination path of PhotoEditorSDK and VideoEditorSDK.


NOTE: Do not mix up PhotoEditorSaveSettings and VideoEditorSaveSettings in the same SettingsList, this is not supported!


4. Choose the destination for your export.

We have to break the API of PhotoEditorSaveSettings, we removed the methods setOutputFilePath, setExportDir and setExportPrefix.

Since v8 use can use one of the following 3 options to save your export.

  1. Option: PhotoEditorSaveSettings.setOutputToTemp() In this case the result is saved into a temporary file. The Editor do not need any permission to write the file. You have to move or remove this file after you are done with it, otherwise you will waste Storage space.

  2. Option: PhotoEditorSaveSettings.setOutputToUri(outputUri: Uri) In this case the result is saved into your file- or content-uri. The Editor will NOT ask for any write permission! You have to be make sure that you have the right to write to this Uri. If not the user can not export!

  3. Option: PhotoEditorSaveSettings.setOutputToGallery(relativePath: String, name:String) In this case the result is saved into to devices gallery. The editor will ask for write permission before starting the exporting. You can prevent that by asking the user for this permission before starting the Editor. The name of the file can have SimpleDateFormat patterns like img_<yyyy_MM_dd_HH_mm_ss> the angled brackets are replaced with the result of SimpleDateFormat("yyyy_MM_dd_HH_mm_ss", Locale.US).format(Date()) The default locale is Locale.US you can change it to the device locale by set the static variable AbstractSaveSettings.locale = Locale.getDefault(). See SimpleDateFormat for more details.

5. We removed PhotoEditorSaveSettings.setSavePolicy.

Use PhotoEditorSaveSettings.setOutputMode instead.

There are only 3 options now.

  1. Option: OutputMode.EXPORT_ALWAYS, the editor always starts the export. This is useful when you want to make sure your output format is being followed.

  2. Option: OutputMode.EXPORT_IF_NECESSARY, the editor only starts the export if changes have been made to the input. Your export settings may not be taken into account in this case.

  3. Option: OutputMode.EXPORT_ONLY_SETTINGS_LIST, the editor will never export. This is useful, for example, if you only want to save a serialization.

6. We changed the parameter type of PhotoEditorSaveSettings.setExportFormat

Use the enum ImageExportFormat as input parameter instead.

7. Some of the SaveSettings functionality is now in EditorSaveState.

  • SaveSettings.saveResult is now EditorSaveState.saveResult
  • SaveSettings.Events.EXPORT_START is now EditorSaveState.Events.EXPORT_START
  • SaveSettings.Events.EXPORT_DONE is now EditorSaveState.Events.EXPORT_DONE
  • SaveSettings.Events.EXPORT_START_IN_BACKGROUND is now EditorSaveState.Events.EXPORT_START_IN_BACKGROUND

8. Internal Kotlin converting of some classes

We have converted some of our classes into Kotlin, the signature should be the same in Java. But it can result in Kotlin syntax changes on your side like:

  1. Changed Nullable and Nonnull types.
  2. Changed variable/getter/setter access.