nanchen2251 / CompressHelper

:fire: 压缩文件,压缩图片,压缩Bitmap,Compress, CompressImage, CompressFile, CompressBitmap:https://github.com/nanchen2251/AiYaCompressHelper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

两个小问题

zhouzidan opened this issue · comments

问题一
options.inSampleSize = calculateInSampleSize(options, actualWidth, actualHeight);
这里options里面的宽度和高度可能没有值,你需要再次设值
if (actualWidth > 0 && actualHeight > 0) {
options.outHeight = actualHeight;
options.outWidth = actualWidth;
}
问题二
bitmap2这个对象没有调用recycle()

谢谢指出。我有空了看一下。

bitmap不需要recycle,
因为我添加了
options.inPurgeable = true;
ptions.inInputShareable = true;