Memory incremental when using filter image (PhotoEditor SDK)

381 Views Asked by At

I have an activity to set filter on image by PhotoEditor SDK library.

But after applying several changes to the image, the memory is heavily increasing, and eventually the app will automatically crash without any error.

In this video, I've been shown with example of this problem. On the monitor screen, the graph displays the memory in realtime mode, And in the phone, There is one seekbar to control brightness of image.

Used code for loading image in layout:

<ja.burhanrashid52.photoeditor.PhotoEditorView
    android:id="@+id/photoEditorView"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:photo_src="@drawable/example_breaking" />

Used code for seekbar action:

controlSeek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
        myBrightness = seekBar.getProgress();
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

        progress = ((int)Math.round(progress/stepSize))*stepSize;
        seekBar.setProgress(progress);

        float myLevel = 1f;

        if ( progress == 0 )
            myLevel = 0.1f;
        else if ( progress > 0 )
            myLevel = (float) progress / 55;

            customEffect = new CustomEffect.Builder(EffectFactory.EFFECT_BRIGHTNESS)
                    .setParameter("brightness", myLevel)
                    .build();

            mPhotoEditor.setFilterEffect(customEffect);

    }

});
0

There are 0 best solutions below