社区问题页面 ViewPager Adapter 更换
This commit is contained in:
@ -8,8 +8,6 @@ import android.graphics.PixelFormat;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.ExifInterface;
|
||||
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
@ -62,6 +60,8 @@ public class BitmapUtils {
|
||||
* @param filePath
|
||||
* @return
|
||||
*/
|
||||
|
||||
// TODO 应该根据图片分辨率大小 采取不同的压缩方式 (质量/分辨率)
|
||||
public static boolean savePicture(String newPath, String filePath, int compressSize) {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(filePath, options);
|
||||
@ -84,10 +84,8 @@ public class BitmapUtils {
|
||||
result = Bitmap.createBitmap(result, 0, 0, result.getWidth(), result.getHeight(), matrix, true);
|
||||
bos.reset();
|
||||
result.compress(Bitmap.CompressFormat.JPEG, 85, bos);
|
||||
Utils.log("========11::" + bos.toByteArray().length );
|
||||
}
|
||||
|
||||
Utils.log("========22::" + bos.toByteArray().length );
|
||||
|
||||
File file = new File(newPath);
|
||||
try {
|
||||
@ -98,8 +96,6 @@ public class BitmapUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
File file1 = new File(newPath);
|
||||
Utils.log("========zzz::" + file1.length() );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user