Repository Details
Shared by
HelloGitHub Rating
0 ratings
图片压缩是常见的问题
Past 7 days Received 2 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 13,769 | — |
| 周三 | 13,771 | +2 |
| 周四 | 13,771 | 0 |
| 周五 | 13,771 | 0 |
| 周六 | 13,771 | 0 |
| 周日 | 13,771 | 0 |
| 周一 | 13,771 | 0 |
13.8k
Stars
Yes
Chinese
C
Language
Yes
Active
16
Contributors
2
Issues
No
Organization
None
Latest
2k
Forks
Apache-2.0
License

图片压缩是常见的问题,那么微信是如何处理图像的压缩?Luban(鲁班)就是通过在微信朋友圈发送近 100 张不同分辨率的图片,对比原图与微信压缩后的图片逆向推算出来的压缩算法。示例代码:
```java
// 同步调用
Flowable.just(photos)
.observeOn(Schedulers.io())
.map(new Function<List<String>, List<File>>() {
@Override public List<File> apply(@NonNull List<String> list) throws Exception {
// 同步方法直接返回压缩后的文件
return Luban.with(MainActivity.this).load(list).get();
}
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe();
```
Included in:
Vol.36
Comments
Rating:
No comments yet