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

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference #57

Open
gelbertgel opened this issue Nov 29, 2017 · 3 comments

Comments

@gelbertgel
Copy link

gelbertgel commented Nov 29, 2017

I used 1.3.5 version. If I want compress like this, I'm getting above error:

Luban.compress(mContext, new File(bigPath))
                .putGear(Luban.CUSTOM_GEAR)
                .setMaxWidth(bigImageWidth)
                .setMaxHeight(bigImageHeight)
                .setCompressFormat(Bitmap.CompressFormat.JPEG)
                .launch(new OnCompressListener() {
                    @Override
                    public void onStart() {

                    }

                    @Override
                    public void onSuccess(File file) {
                        compressThumbImage(file, bigPath, compressImageListener);
                    }

                    @Override
                    public void onError(Throwable e) {
                        **Mylog.e(TAG + " compressBigAndThumbImages error:", e.getMessage());**
                    }
                });

Please help me!!

@young508
Copy link

young508 commented Dec 1, 2017

the same error

@h93910
Copy link

h93910 commented Nov 27, 2018

我也遇到了

@po1xiao
Copy link

po1xiao commented May 21, 2019

是因为没有读取存储权限吧

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

4 participants