Capacitor plugin that allows the user to edit a photo.
npm install @capawesome/capacitor-photo-editor
npx cap sync
You need to specify the directories that contain the photos you want to edit.
To specify the directories, start by creating the file file_paths.xml
in the res/xml/
subdirectory of your project (see Android docs).
This is an example:
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="files" path="." />
<cache-path name="cache" path="." />
<external-files-path name="external-files" path="." />
<external-cache-path name="external-cache" path="." />
<external-path name="external" path="." />
</paths>
No configuration required for this plugin.
A working example can be found here: robingenz/capacitor-plugin-demo
Android |
---|
import { PhotoEditor } from '@capawesome/capacitor-photo-editor';
const editPhoto = async () => {
await PhotoEditor.editPhoto({ path: 'data/image.png' });
};
editPhoto(options: EditPhotoOptions) => Promise<void>
Edit a photo at a given path.
Attention: A suitable photo editing app must be installed (e.g. Google Photos) and the user should overwrite the image when saving so that the path to the image is not lost.
Only available on Android.
Param | Type |
---|---|
options |
EditPhotoOptions |
Prop | Type | Description |
---|---|---|
path |
string |
The path of the file to edit. |
See CHANGELOG.md.
See LICENSE.
This plugin is based on the Capacitor Photo Editor plugin. Thanks to everyone who contributed to the project!