[code_opt_3.3.0] remove unuse log and fix bug of trace link

This commit is contained in:
zhongchao
2023-06-15 11:51:17 +08:00
parent 23ed2e4315
commit fef4bf97bb
13 changed files with 165 additions and 137 deletions

View File

@@ -1,7 +1,5 @@
package com.mogo.eagle.core.utilcode.util;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_UTIL;
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
@@ -26,7 +24,6 @@ import android.text.TextUtils;
import android.util.Base64;
import com.elegant.utils.IOUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -123,18 +120,12 @@ public class BitmapHelper {
if ( quality == 100 ) {
fullSize = bos.size();
}
CallerLogger.INSTANCE.i( M_UTIL + TAG, "quality<---->size, " + quality + "<---->" + bos.size() / 1024 );
}
while ( bos.size() > maxSizeOfBytes && ( quality -= ( fullSize > ONE_MB ) ? 10 : 5 ) >= 0 );
result = bos.toByteArray();
final long end = System.currentTimeMillis();
CallerLogger.INSTANCE.i( M_UTIL + TAG,
"bitmap to bytes costs " + ( end - start ) + "ms, \n" +
"bitmap full size is " + ( fullSize / 1024 ) + "kb, \n" +
"bitmap final size is " + ( bos.size() / 1024 ) + "kb, \n" +
"bitmap quality is " + quality );
} catch ( Exception e ) {
e.printStackTrace();
result = null;
@@ -297,7 +288,6 @@ public class BitmapHelper {
sampleSize = sampleSize << 1;
}
CallerLogger.INSTANCE.i( M_UTIL + TAG, "sample size is " + sampleSize );
return sampleSize;
}
@@ -338,8 +328,6 @@ public class BitmapHelper {
} catch ( Exception e ) {
e.printStackTrace();
}
CallerLogger.INSTANCE.i( M_UTIL + TAG, "ExifInterface, degree is " + degree );
return degree;
}
@@ -416,7 +404,6 @@ public class BitmapHelper {
final long start = System.currentTimeMillis();
if ( bitmap == null || file == null ) {
CallerLogger.INSTANCE.i( M_UTIL + TAG, "保存失败, bitmap or file is null." );
return;
}
if ( file.getParentFile() != null && !file.getParentFile().exists() ) {
@@ -428,15 +415,9 @@ public class BitmapHelper {
bitmap.compress( Bitmap.CompressFormat.JPEG, 100, fos );
fos.flush();
fos.close();
if ( file.exists() ) {
CallerLogger.INSTANCE.i(M_UTIL + TAG, "保存成功" );
}
} catch ( Exception e ) {
e.printStackTrace();
}
CallerLogger.INSTANCE.i( M_UTIL + TAG, "saving picture costs " + ( System.currentTimeMillis() - start ) + "ms" );
}
/**