question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OOM - Samsung galaxy GT-I9300 Android 4.3

See original GitHub issue

Great Library, Working really well except this OOM issue on the device above It can be fixed but the problem is inside PickerDialog.kt the function takePhoto at line:452 is private so It cant overridden. Normally I deal with this by using method to tweak the bitmap before rotating which should fix this issue (Java) `{

    try {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = false;
        options.inPreferredConfig = Bitmap.Config.RGB_565;
        options.inDither = true;
        Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), options);

        ExifInterface exif = new ExifInterface(file.getAbsolutePath());
        int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
        Matrix matrix = new Matrix();
        if (orientation == 6) {
            matrix.postRotate(90);
        }
        else if (orientation == 3) {
            matrix.postRotate(180);
        }
        else if (orientation == 8) {
            matrix.postRotate(270);
        }
        myBitmap = Bitmap.createBitmap(myBitmap, 0, 0, myBitmap.getWidth(), myBitmap.getHeight(), matrix, true); // rotating bitmap
        imageView.setImageBitmap(myBitmap);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}`

And here is Stacktrace 03-29 15:01:32.110 11420-11420/com.go.app.dev E/AndroidRuntime: FATAL EXCEPTION: main java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:726) at android.graphics.Bitmap.createBitmap(Bitmap.java:703) at android.graphics.Bitmap.createBitmap(Bitmap.java:636) at com.robertlevonyan.components.picker.ExtensionsKt.rotate(Extensions.kt:76) at com.robertlevonyan.components.picker.PickerDialog.takePhoto(PickerDialog.kt:462) at com.robertlevonyan.components.picker.PickerDialog.onActivityResult(PickerDialog.kt:444) at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:156) at android.app.Activity.dispatchActivityResult(Activity.java:5563) at android.app.ActivityThread.deliverResults(ActivityThread.java:3496) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3543) at android.app.ActivityThread.access$1200(ActivityThread.java:159) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) at dalvik.system.NativeStart.main(Native Method)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ChrisSherlock91commented, Mar 30, 2018

Working correctly now, Thank you

0reactions
robertlevonyancommented, Apr 9, 2018

?

Read more comments on GitHub >

github_iconTop Results From Across the Web

OOM - Samsung galaxy GT-I9300 Android 4.3 · Issue #1 ... - GitHub
Great Library, Working really well except this OOM issue on the device above It can be fixed but the problem is inside PickerDialog.kt...
Read more >
[Official Firmwares] I9300XXUGML2 (Android 4.3) - XDA Forums
Samsung Galaxy S III GT-I9300 Stock Firmware Collection [U]All stock firmwares are brought to you byMod Edit link removed Model: GT-I9300 ...
Read more >
Android 4.3 Jelly Bean update now rolling out for Samsung ...
After releasing Android 4.3 update for the Galaxy S4, Samsung has finally started rolling out the new update for the Galaxy S III...
Read more >
Samsung Galaxy S III (GT-I9300) picking up Android 4.3 Updates ...
Samsung has begun to finally push out the long awaited update to Android 4.3. Many of you might remember that a leaked version...
Read more >
Specs Samsung Galaxy S III GT-I9300 12.2 cm (4.8") Dual SIM ...
Samsung Galaxy S III GT-I9300 12.2 cm (4.8") Dual SIM Android 4.3 3G Micro-USB A 16 GB 2100 mAh White · - 12.2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found