LGImageCompressor
LGImageCompressor copied to clipboard
android图片压缩的处理
金立手机,android版本6.0压缩后返回的图片是空白,或者有个一像素的点,其他手机在不确定的情况下,也会出现返回空白图,或者叫做一像素的图。
public interface CompressServiceListener { void onCompressServiceStart(); void onCompressServiceEnd(ArrayList compressResults); } 你的代码还是旧的把。这2个方法好像没有用到哦,还是用的之前的广播发送消息的。我想一种在后台监测。是不是在这个方法不要调用 stopSelf(taskId);就行了啊?我压缩之后的文件是空的,为啥子? synchronized (lock){ compressResults.add(compressResult); taskNumber--; if(taskNumber
测试机:google nexus 5x lg android7.1.1 第一次拍照可以得到正常图片,第二次及以后拍照得到的是一张纯色的图片 该问题在Android7.0以下版本不会出现
图片尺寸压缩部分
options.inSampleSize = computSampleSize(options, actualOutWidth, actualOutHeight); options.inJustDecodeBounds = false; Bitmap scaledBitmap = null; try { scaledBitmap = BitmapFactory.decodeFile(srcImagePath, options); } catch (OutOfMemoryError e) { e.printStackTrace(); } if (scaledBitmap == null) {...