Image Editing

This documentation outlines the guidelines for utilizing the Image Module SDK, which offers powerful image editing tools. The SDK provides straightforward methods to incorporate advanced image editing functionalities into your

Prerequisites

  • Ensure you have integrated the TruVideo Core SDK into your project and completed with the authentication process

  • Camera module will provide MediaItem or simply provide filepath to upload (optional)

Edit an Image

To edit an image, follow these steps:

Step 1 : Get Result File path where to place the save image

This function returns the result path using the provided file name as input.

final resultPath = "${widget.directoryPath}/editImage_${timestamp}.png"

Step 2 : Call Image Edit

After obtaining the result path, invoke the launchImageEdit function to edit

void editImage(String imagePath) async {
  TruvideoImageSdk.editImage(
    inputPath: imagePath,
    outputPath: resultPath,
    onResult: (String? result) {
      print("Image edited successfully: $result");
    },
    onError: (String? message) {
      print("Image editing failed: $message");
    },
  );
}

Finalize :

After completing this steps the function should look like

void editImage(String imagePath) async {
  final resultPath = "${widget.directoryPath}/editImage_${timestamp}.png"
  TruvideoImageSdk.editImage(
    inputPath: imagePath,
    outputPath: resultPath,
    onResult: (String? result) {
      print("Image edited successfully: $result");
    },
    onError: (String? message) {
      print("Image editing failed: $message");
    },
  );
}

Learn More

Explore advanced capabilities of the Image Module in the Image Module Reference.

Last updated

Was this helpful?