Truvideo Image SDK

This plugin integrates TruvideoImageSdk for handling image files, including browsing, editing, and displaying images.

Supported Platforms

  • Android
  • iOS

Features

  • Loads and displays images from a directory
  • Edits images using the SDK

Requirements

  • TruvideoImageSdk Plugin

Setup

  1. Add TruvideoImageSdk Plugin to your project.
  2. Install dependencies:
    flutter pub get
    
  3. Ensure proper permissions in AndroidManifest.xml & Info.plist.
  4. Run the app:
    flutter run
    

Usage

  • Load images from a directory:
    List<String> getAllImagePathsInDirectory(String directoryPath) {
      final directory = Directory(directoryPath);
      List<String> imagePaths = [];
    
      if (directory.existsSync()) {
        directory.listSync(recursive: true).forEach((file) {
          if (file is File && ['png', 'jpeg', 'jpg'].contains(file.path.split('.').last.toLowerCase())) {
            imagePaths.add(file.path);
          }
        });
      }
      return imagePaths;
    }
    
  • Edit an image:
    void editImage(String imagePath) async {
      TruvideoImageSdk.editImage(
        inputPath: imagePath,
        outputPath: imagePath,
        onResult: (String? result) {
          print("Image edited successfully: \$result");
        },
        onError: (String? message) {
          print("Image editing failed: \$message");
        },
      );
    }
    

License

MIT

Support

If you have any questions or suggestions regarding the SDK, please contact us at [email protected].