Commit 4787cd559a899e20ff825391bf455338514630be

Authored by 朱显松
1 parent 28b544c8

优化预览图片质量,尺寸100->320

config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "1.1.5.0",
  24 + version: "1.1.5.1",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.media",
27 27 //Lib库名称
... ...
lib_media/src/main/java/com/cnlive/media/ui/widget/crop/CropUtil.java
... ... @@ -181,7 +181,7 @@ public class CropUtil {
181 181 if (file.exists())
182 182 file.delete();
183 183 FileOutputStream fos = new FileOutputStream(file);
184   - bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
  184 + bitmap.compress(Bitmap.CompressFormat.JPEG, 320, fos);
185 185 fos.flush();
186 186 fos.close();
187 187 bitmap.recycle();
... ...
lib_media/src/main/java/com/cnlive/media/utils/AndroidQUtil.java
... ... @@ -183,7 +183,7 @@ public class AndroidQUtil {
183 183 if (imageFileDirctory.exists()) {
184 184 File imageFile = new File(PICTURES + "/" + signImage + "/" + fileName);
185 185 FileOutputStream fileOutputStream = new FileOutputStream(imageFile, false);
186   - bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
  186 + bitmap.compress(Bitmap.CompressFormat.JPEG, 320, fileOutputStream);
187 187 fileOutputStream.flush();
188 188 return imageFile.getAbsolutePath();
189 189 } else if (imageFileDirctory.mkdir()) {
... ... @@ -191,7 +191,7 @@ public class AndroidQUtil {
191 191 File imageFile = new File(PICTURES + "/" + signImage + "/" + fileName);
192 192 //通过流将图片写入
193 193 FileOutputStream fileOutputStream = new FileOutputStream(imageFile);
194   - bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
  194 + bitmap.compress(Bitmap.CompressFormat.JPEG, 320, fileOutputStream);
195 195 fileOutputStream.flush();
196 196 fileOutputStream.close();
197 197 return imageFile.getAbsolutePath();
... ...
lib_media/src/main/java/com/cnlive/media/utils/FileUtils.java
... ... @@ -166,7 +166,7 @@ public class FileUtils {
166 166 try {
167 167 FileOutputStream fout = new FileOutputStream(jpegName);
168 168 BufferedOutputStream bos = new BufferedOutputStream(fout);
169   - b.compress(Bitmap.CompressFormat.JPEG, 100, bos);
  169 + b.compress(Bitmap.CompressFormat.JPEG, 320, bos);
170 170 bos.flush();
171 171 bos.close();
172 172 File newFile= new File(jpegName);
... ...
lib_media/src/main/java/com/cnlive/media/utils/GlideCacheUtil.java
... ... @@ -378,7 +378,7 @@ public class GlideCacheUtil {
378 378 @Override
379 379 public void subscribe(ObservableEmitter<Bitmap> emitter) throws Exception {
380 380 ContentResolver contentResolver = context.getContentResolver();
381   - Bitmap bm = contentResolver.loadThumbnail(mediaUri, new Size(100, 100), null);
  381 + Bitmap bm = contentResolver.loadThumbnail(mediaUri, new Size(320, 320), null);
382 382 if (bm != null) {
383 383 emitter.onNext(bm);
384 384 } else {
... ...
lib_media/src/main/java/com/cnlive/media/utils/album/AlbumProcessUtil.java
... ... @@ -113,7 +113,7 @@ public class AlbumProcessUtil {
113 113 filePic.createNewFile();
114 114 }
115 115 FileOutputStream fos = new FileOutputStream(filePic);
116   - mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
  116 + mBitmap.compress(Bitmap.CompressFormat.JPEG, 320, fos);
117 117 fos.flush();
118 118 fos.close();
119 119  
... ... @@ -414,7 +414,7 @@ public class AlbumProcessUtil {
414 414 filePic.createNewFile();
415 415 }
416 416 FileOutputStream fos = new FileOutputStream(filePic);
417   - mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
  417 + mBitmap.compress(Bitmap.CompressFormat.JPEG, 320, fos);
418 418 fos.flush();
419 419 fos.close();
420 420  
... ... @@ -441,7 +441,7 @@ public class AlbumProcessUtil {
441 441 filePic.createNewFile();
442 442 }
443 443 FileOutputStream fos = new FileOutputStream(filePic);
444   - mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
  444 + mBitmap.compress(Bitmap.CompressFormat.JPEG, 320, fos);
445 445 fos.flush();
446 446 fos.close();
447 447  
... ... @@ -464,7 +464,7 @@ public class AlbumProcessUtil {
464 464 filePic.createNewFile();
465 465 }
466 466 FileOutputStream fos = new FileOutputStream(filePic);
467   - mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
  467 + mBitmap.compress(Bitmap.CompressFormat.JPEG, 320, fos);
468 468 fos.flush();
469 469 fos.close();
470 470 } catch (IOException e) {
... ...