Reduce usage of Log.w()

This commit is contained in:
Greyson Parrelli
2018-08-02 09:25:33 -04:00
parent a498176043
commit 43068e0613
115 changed files with 400 additions and 387 deletions
@@ -84,7 +84,7 @@ public class BitmapUtil {
scaledBitmap.compress(CompressFormat.JPEG, quality, baos);
bytes = baos.toByteArray();
Log.w(TAG, "iteration with quality " + quality + " size " + (bytes.length / 1024) + "kb");
Log.d(TAG, "iteration with quality " + quality + " size " + (bytes.length / 1024) + "kb");
if (quality == MIN_COMPRESSION_QUALITY) break;
int nextQuality = (int)Math.floor(quality * Math.sqrt((double)maxImageSize / bytes.length));
@@ -103,7 +103,8 @@ public class BitmapUtil {
throw new BitmapDecodingException("Decoding failed. Bitmap has a length of " + bytes.length + " bytes.");
}
Log.w(TAG, "createScaledBytes(" + model.toString() + ") -> quality " + Math.min(quality, MAX_COMPRESSION_QUALITY) + ", " + attempts + " attempt(s)");
Log.i(TAG, "createScaledBytes(" + model.toString() + ") -> quality " + Math.min(quality, MAX_COMPRESSION_QUALITY) + ", " + attempts + " attempt(s)");
return new ScaleResult(bytes, scaledBitmap.getWidth(), scaledBitmap.getHeight());
} finally {
if (scaledBitmap != null) scaledBitmap.recycle();