Comments (10)
好 那具体拍出来的图片多大 5M?
应该对大图采取压缩策略比较合适 因为想存下来的图尽量清晰
from boxing.
这个是写文件操作。
如果像你这样修改,那不需要旋转的时候就不写文件了啊。
from boxing.
不需要旋转的时候还需要写文件吗,默认拍照完成的时候已经写文件了啊
from boxing.
有道理,我改下,感谢反馈。
from boxing.
这里还有个细节要改一下哦,就是在三星s5和魅族2都会oom,我看下主要是图片太大了,应该旋转的时候先压缩下哦,我改了下,效果不错,可以加个好友聊聊,这个项目开源非常的不错哦 373486276
from boxing.
try {
int degree = BoxingExifHelper.getRotateDegree(file.getAbsolutePath());
Matrix matrix = new Matrix();
if (degree != 0) {
matrix.postRotate(degree);
bitmap = ImageCompressor.compressSize(file.getAbsolutePath());
outBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, false);
outputStream = new FileOutputStream(file);
outBitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
outputStream.flush();
}
return true; 我是这么处理的,适配了不少机型,都不错
from boxing.
拍出来的图片会有多大?
from boxing.
在三星s5上,我算了下图片加载到内存的时候将近50M,直接爆了
from boxing.
差不多吧,拍照图片一般在4-5M左右,加载到内存大概在40-50M左右,所以容易爆炸,ImageCompressor中的compressDisplay方法压缩应该能达到预期的效果。
from boxing.
我本来想把画质options.inPreferredConfig = Bitmap.Config.RGB_565;也压缩下,想想怕质量受到影响就暂时不做,先按compressDisplay做,然后测试N个机型,看看反馈的情况在定。。。你有什么好建议记得发我下。
from boxing.
Related Issues (20)
- Android resource linking failed HOT 2
- Video need camera not work. How to solve this problem
- Android Q SQLiteException HOT 6
- 图片预览闪退,报方法找不到 HOT 1
- Why not support setIntent(Intnet intent) method to turn to select(UI Activity)?
- 在选择图片页面新功能需求
- Android 10 crash HOT 7
- implementation 'com.bilibili:boxing-impl:1.0.4' 报错 HOT 1
- 模拟器点击图片选择闪退 HOT 3
- 可以合并下修复android10上面的bug的分支吗
- Android Q SQLiteException HOT 7
- Android 10 crash #临时解决方案 HOT 8
- Weak Cryptographic Hash
- Unused Field
- Android 10 crash的问题不准备解决了吗? HOT 2
- Android 11也报错了 HOT 1
- .
- 关于崩溃和适配的问题,可以看这里 HOT 2
- 图片多选问题
- 请问如何支持圆形裁剪 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boxing.