Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black Screen On Redmi 4A #10

Open
nickghodke opened this issue Nov 18, 2017 · 5 comments
Open

Black Screen On Redmi 4A #10

nickghodke opened this issue Nov 18, 2017 · 5 comments

Comments

@nickghodke
Copy link

Device: Redmi
Model number: Redmi 4A
Using this lib's app in the above mentioned device, I get a black screen whether I import image (which was clicked by camera) from gallery or take a photo using the camera in the app.

@vasiledoe
Copy link

Same to me galaxy J5

@nickghodke
Copy link
Author

i resolved it by changing the value of options.inSampleSize to 6 instead of 1
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 6; in PhotoEditorActivity.

Previously it was
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 1;

@sreekanth100khere
Copy link

@nickghodke Any clue why it worked? And where did you come up with this "magic number" 6 from. If you have more information regarding the bug & fix please let me know.

@nickghodke
Copy link
Author

Did it worked for you i actually dont remember it right now but i was getting an issue on that sampleInSize while debugging so i changed it to randomly 6 other than 1 and it worked for me

@sreekanth100khere
Copy link

sreekanth100khere commented Mar 26, 2019

The documentation says so:-

/**
        * If set to a value > 1, requests the decoder to subsample the original
        * image, returning a smaller image to save memory. The sample size is
        * the number of pixels in either dimension that correspond to a single
        * pixel in the decoded bitmap. For example, inSampleSize == 4 returns
        * an image that is 1/4 the width/height of the original, and 1/16 the
        * number of pixels. Any value <= 1 is treated the same as 1. Note: the
        * decoder uses a final value based on powers of 2, any other value will
        * be rounded down to the nearest power of 2.
        */
    So regardless of you use 4 or 6 the value that is taken is 4, if you want to make a difference, you should use the value 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants