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

Engine 类 compress 方法 tagBitmap 报空指针 #318

Closed
EspoirX opened this issue Jan 2, 2019 · 16 comments
Closed

Engine 类 compress 方法 tagBitmap 报空指针 #318

EspoirX opened this issue Jan 2, 2019 · 16 comments

Comments

@EspoirX
Copy link

EspoirX commented Jan 2, 2019

Engine 类 compress 方法 tagBitmap 报空指针

@EspoirX EspoirX changed the title 空指针 Engine 类 compress 方法 tagBitmap 报空指针 Jan 2, 2019
@erleizh
Copy link

erleizh commented Jan 8, 2019

6561-7285 W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference
6561-7285 W/System.err:     at top.zibin.luban.Engine.compress(Engine.java:79)
6561-7285 W/System.err:     at top.zibin.luban.Luban.get(Luban.java:152)
6561-7285 W/System.err:     at top.zibin.luban.Luban.access$1100(Luban.java:21)
6561-7285 W/System.err:     at top.zibin.luban.Luban$Builder.get(Luban.java:354)
6561-7285 W/System.err:     at com.yanzhenjie.durban.EditFilterActivity$FileCopyTask.doInBackground(EditFilterActivity.java:541)
6561-7285 W/System.err:     at com.yanzhenjie.durban.EditFilterActivity$FileCopyTask.doInBackground(EditFilterActivity.java:530)
6561-7285 W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:333)
6561-7285 W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
6561-7285 W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
6561-7285 W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
6561-7285 W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
6561-7285 W/System.err:     at java.lang.Thread.run(Thread.java:764)

@colder112
Copy link

一样啊,出现在vivo的手机上了.华为和小米就没问题

@colder112
Copy link

更新到最新的1.1.8就好了

@erleizh
Copy link

erleizh commented Jan 9, 2019

@colder112 turbo 也是1.1.8 吗

@erleizh
Copy link

erleizh commented Jan 9, 2019

不对 , 我用的就是1.1.8 的 ,

@colder112
Copy link

top.zibin:Luban:1.1.8

@colder112
Copy link

我用的这个就ok了..

@colder112
Copy link

不知道你出问题的手机型号是啥...

@LiaoYuqiangzz
Copy link

LiaoYuqiangzz commented Jan 22, 2019

我也是报这个错,小米5X Android 8.1.0系统,而且我是1.1.8版本

@yxd0605
Copy link

yxd0605 commented Jan 29, 2019

同样出现报错!并不是必现,是概率性出现
版本:top.zibin:Luban:1.1.8;
出现机型:一加 A5010;
Android版本:9.0

@EspoirX
Copy link
Author

EspoirX commented Jan 29, 2019

如果传入的不是图片格式,就会必现,现在是通过下载源码修改了

@yxd0605
Copy link

yxd0605 commented Feb 20, 2019

如果传入的不是图片格式,就会必现,现在是通过下载源码修改了

传入的是图片,也有概率会出现闪退

@xingxiang1989
Copy link

同样出现该问题,在vivo x9s,Vivo Nex A

@EspoirX EspoirX closed this as completed Mar 4, 2019
@fazhongxu
Copy link

20190315174718

@fazhongxu
Copy link

虽然外部抛出了IO Exception 并且try catch 住了,但是,人家是NullPointerException 可以在此解决这个bug

@anjiuzhe
Copy link

这种是图片损坏了,压缩后会出现这种情况。
我目前是这样处理的,调用压缩前先对bitmap判空处理。
Bitmap bitmap = BitmapFactory.decodeFile(picPath);
try {
bitmap.getWidth();
} catch (Exception e) {
//图片损坏
return;
}
//开始压缩
、、、

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

8 participants