lexluthors/CompressTools-Android

压缩图片没有走onSuccess的回调,压缩失败没有onCompressFailed()回调

Opened this issue · 13 comments

/**
* description:
* author: liujie
* date: 2017/8/22 18:19
*/
public void compressToFileJni(final File file, final OnCompressListener mOnCompressListener)
{
FileUtil.runOnSubThread(new Runnable()
{
@OverRide
public void run()
{
BitmapUtil.compressImageJni(context, Uri.fromFile(file), maxWidth, maxHeight, compressFormat, bitmapConfig, quality, destinationDirectoryPath,
fileNamePrefix, fileName, optimize, keepResolution, mOnCompressListener);
}
});
}

这段代码里面BitmapUtil.compressImageJni的参数Uri使用了Uri.fromFile(file)没有考虑Android7.0的情况吧

另外再提一点,多线程压缩没有所有完成的回调。希望博主改进哈。

是个别手机有问题吗?还是所有的都有问题呢?

我所测试的三星,小米,华为,模拟器都有此类问题,均无法成功压缩图片

不可能吧,我测试的手机都成功了,你能不能把demo用邮箱发给我一份?

检查一下传进去的file是否有效

没有回调的啊~ 魅族pro6s

你是集成进去的还是直接下载这个demo跑的?这个demo你试试能跑吗?

博主有没有改进没有压缩成功回调的问题呢?
我的小米5S 还是这样的问题....

调起手机拍照回返回路径去压缩也有这个问题,Log显示Raw image not detected
10-13 15:02:21.643 14026-16992/com.emaotai.ysapp I/ExifInterface_JNI: Raw image not detected 10-13 15:02:21.644 14026-16992/com.emaotai.ysapp W/ExifInterface: Skip the tag entry since tag number is not defined: 2
失败应该增加失败通知回调
我使用Android 7.0.1 一加5手机测试

貌似Android7.x以上的手机都会显示Raw image not detected