合并后续
This commit is contained in:
@ -8,6 +8,8 @@ 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;
|
||||
@ -64,7 +66,6 @@ public class BitmapUtils {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(filePath, options);
|
||||
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 85, bos);
|
||||
float zoom = (float) Math.sqrt(compressSize / (float) bos.toByteArray().length);
|
||||
@ -83,8 +84,11 @@ 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 {
|
||||
BufferedOutputStream fbos = new BufferedOutputStream(new FileOutputStream(file));
|
||||
@ -94,6 +98,8 @@ public class BitmapUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
File file1 = new File(newPath);
|
||||
Utils.log("========zzz::" + file1.length() );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user