Re-editing image with same name return only latest changes over original image using PhotoEditor SDK

218 views Asked by At

I am using photo editor android sdk in my app to edit images.When I am using same image for different editing operations like apply stickers, filters or other changes.I do editing and save image with same name and then perform editing again, but the second time when trying to save changes it returns original image with only latest changes.

currently I have to provide different name each time for editing.but It is not permanent solution.Please help.

1

There are 1 answers

4
Qandil Tariq On
/**
 * We need to notify the MediaScanner when a new file is created.
 * In this way all the gallery applications will be notified too.
 *
 * @param filepath
 */
private void updateMedia( String filepath ) {
    Log.i( LOG_TAG, "updateMedia: " + filepath );
    MediaScannerConnection.scanFile( getApplicationContext(), new String[] { filepath }, null, null );
}

For application data :

if (output.exists()){
output.delete(); //DELETE existing file
        fileName = "myfile.jpg";
        output = new File(imagesFolder, fileName);

    }