Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffbc6ec0 authored by jinwu's avatar jinwu Committed by Rajshekar Eashwarappa
Browse files

Fix the crash issue in TruePortrait.

If nativeGetPreviewSize return false , then the iamge
is still not applied true portrait effect.

Change-Id: I8dbb27f0d82cd5441c81a2e3e9ae392488972732
CRs-Fixed: 2099040
parent 2a4937b2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -97,15 +97,17 @@ public class TruePortraitNativeEngine {
    }

    public boolean init(Context context, Bitmap src, Rect[] faces) {
        setFacesDetected(true);
        boolean result = false; 
        if(nativeInit(src, faces.length, faces)) {
            nativeGetPreviewSize(mPreviewSize);
            result = nativeGetPreviewSize(mPreviewSize);
        }
        if (result) {
            mSketchBm = BitmapFactory.decodeResource(context.getResources(), R.raw.sketch_bm);
            return true;
        } else {
            mSketchBm = null;
            return false;
        }
        setFacesDetected(result);   
        return result;
    }

    public void release() {