iamutkarshtiwari / Ananas

An easy image editor integration for your Android apps.
MIT License
250 stars 112 forks source link

OutPutFilePath #67

Closed joemerritt closed 3 years ago

joemerritt commented 3 years ago

Hi, I continually get the error

E/Demo App: Output image path required. Use withOutputPath(path) to provide the output image path.

Using the below:

File storageDir = new File(Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + "/Storage/");

    try {
        Intent intent = new ImageEditorIntentBuilder(this, sourceImagePath, storageDir.toString())
                .withAddText() // Add the features you need
                .withPaintFeature()
                .withFilterFeature()
                .withRotateFeature()
                .withCropFeature()
                .withBrightnessFeature()
                .withSaturationFeature()
                .withBeautyFeature()
                .withStickerFeature()
                .forcePortrait(true)  // Add this to force portrait mode (It's set to false by default)
                .setSupportActionBarVisibility(false) // To hide app's default action bar
                .build();

        EditImageActivity.start(AdvertiserPageSubmitNew.this, intent, PHOTO_EDITOR_REQUEST_CODE);
    } catch (Exception e) {
        Log.e("Demo App", e.getMessage()); // This could throw if either `sourcePath` or `outputPath` is blank or Null
    }

I apologize if this seems basic. Any assistance would be appreciated

thirstycoda commented 3 years ago

It looks like you are providing a path to a directory but you need to provide a path to a file

joemerritt commented 3 years ago

Yep, that's correct. Took me a moment to get it right. Thanks