package o6; import android.graphics.Bitmap; /* loaded from: classes2.dex */ public class c implements e6.m { /* renamed from: b, reason: collision with root package name */ public static final e6.i f12724b = e6.i.f("com.imgmodule.load.resource.bitmap.BitmapEncoder.CompressionQuality", 90); /* renamed from: c, reason: collision with root package name */ public static final e6.i f12725c = e6.i.e("com.imgmodule.load.resource.bitmap.BitmapEncoder.CompressionFormat"); /* renamed from: a, reason: collision with root package name */ private final i6.a f12726a; public c(i6.a aVar) { this.f12726a = aVar; } private Bitmap.CompressFormat c(Bitmap bitmap, e6.j jVar) { Bitmap.CompressFormat compressFormat = (Bitmap.CompressFormat) jVar.d(f12725c); return compressFormat != null ? compressFormat : bitmap.hasAlpha() ? Bitmap.CompressFormat.PNG : Bitmap.CompressFormat.JPEG; } @Override // e6.m public e6.c b(e6.j jVar) { return e6.c.TRANSFORMED; } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:20:0x0073 A[Catch: all -> 0x00c3, TRY_LEAVE, TryCatch #1 {all -> 0x00c3, blocks: (B:3:0x0021, B:15:0x004c, B:18:0x006d, B:20:0x0073, B:42:0x00bf, B:40:0x00c2, B:36:0x0069), top: B:2:0x0021 }] */ /* JADX WARN: Type inference failed for: r9v11 */ /* JADX WARN: Type inference failed for: r9v6 */ /* JADX WARN: Type inference failed for: r9v9 */ @Override // e6.d /* renamed from: d, reason: merged with bridge method [inline-methods] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public boolean a(h6.h r8, java.io.File r9, e6.j r10) { /* r7 = this; java.lang.String r0 = "BitmapEncoder" java.lang.Object r8 = r8.get() android.graphics.Bitmap r8 = (android.graphics.Bitmap) r8 android.graphics.Bitmap$CompressFormat r1 = r7.c(r8, r10) int r2 = r8.getWidth() java.lang.Integer r2 = java.lang.Integer.valueOf(r2) int r3 = r8.getHeight() java.lang.Integer r3 = java.lang.Integer.valueOf(r3) java.lang.String r4 = "encode: [%dx%d] %s" c7.b.c(r4, r2, r3, r1) long r2 = b7.f.b() // Catch: java.lang.Throwable -> Lc3 e6.i r4 = o6.c.f12724b // Catch: java.lang.Throwable -> Lc3 java.lang.Object r4 = r10.d(r4) // Catch: java.lang.Throwable -> Lc3 java.lang.Integer r4 = (java.lang.Integer) r4 // Catch: java.lang.Throwable -> Lc3 int r4 = r4.intValue() // Catch: java.lang.Throwable -> Lc3 r5 = 0 java.io.FileOutputStream r6 = new java.io.FileOutputStream // Catch: java.io.IOException -> L50 java.lang.Throwable -> L58 r6.(r9) // Catch: java.io.IOException -> L50 java.lang.Throwable -> L58 i6.a r9 = r7.f12726a // Catch: java.lang.Throwable -> L52 java.io.IOException -> L55 if (r9 == 0) goto L44 f6.c r9 = new f6.c // Catch: java.lang.Throwable -> L52 java.io.IOException -> L55 i6.a r5 = r7.f12726a // Catch: java.lang.Throwable -> L52 java.io.IOException -> L55 r9.(r6, r5) // Catch: java.lang.Throwable -> L52 java.io.IOException -> L55 r5 = r9 goto L45 L44: r5 = r6 L45: r8.compress(r1, r4, r5) // Catch: java.io.IOException -> L50 java.lang.Throwable -> L58 r5.close() // Catch: java.io.IOException -> L50 java.lang.Throwable -> L58 r9 = 1 r5.close() // Catch: java.io.IOException -> L6c java.lang.Throwable -> Lc3 goto L6c L50: r9 = move-exception goto L5a L52: r8 = move-exception r5 = r6 goto Lbd L55: r9 = move-exception r5 = r6 goto L5a L58: r8 = move-exception goto Lbd L5a: r4 = 3 boolean r4 = android.util.Log.isLoggable(r0, r4) // Catch: java.lang.Throwable -> L58 if (r4 == 0) goto L66 java.lang.String r4 = "Failed to encode Bitmap" android.util.Log.d(r0, r4, r9) // Catch: java.lang.Throwable -> L58 L66: r9 = 0 if (r5 == 0) goto L6c r5.close() // Catch: java.io.IOException -> L6c java.lang.Throwable -> Lc3 L6c: r4 = 2 boolean r4 = android.util.Log.isLoggable(r0, r4) // Catch: java.lang.Throwable -> Lc3 if (r4 == 0) goto Lb9 java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> Lc3 r4.() // Catch: java.lang.Throwable -> Lc3 java.lang.String r5 = "Compressed with type: " r4.append(r5) // Catch: java.lang.Throwable -> Lc3 r4.append(r1) // Catch: java.lang.Throwable -> Lc3 java.lang.String r1 = " of size " r4.append(r1) // Catch: java.lang.Throwable -> Lc3 int r1 = b7.k.j(r8) // Catch: java.lang.Throwable -> Lc3 r4.append(r1) // Catch: java.lang.Throwable -> Lc3 java.lang.String r1 = " in " r4.append(r1) // Catch: java.lang.Throwable -> Lc3 double r1 = b7.f.a(r2) // Catch: java.lang.Throwable -> Lc3 r4.append(r1) // Catch: java.lang.Throwable -> Lc3 java.lang.String r1 = ", options format: " r4.append(r1) // Catch: java.lang.Throwable -> Lc3 e6.i r1 = o6.c.f12725c // Catch: java.lang.Throwable -> Lc3 java.lang.Object r10 = r10.d(r1) // Catch: java.lang.Throwable -> Lc3 r4.append(r10) // Catch: java.lang.Throwable -> Lc3 java.lang.String r10 = ", hasAlpha: " r4.append(r10) // Catch: java.lang.Throwable -> Lc3 boolean r8 = r8.hasAlpha() // Catch: java.lang.Throwable -> Lc3 r4.append(r8) // Catch: java.lang.Throwable -> Lc3 java.lang.String r8 = r4.toString() // Catch: java.lang.Throwable -> Lc3 android.util.Log.v(r0, r8) // Catch: java.lang.Throwable -> Lc3 Lb9: c7.b.d() return r9 Lbd: if (r5 == 0) goto Lc2 r5.close() // Catch: java.io.IOException -> Lc2 java.lang.Throwable -> Lc3 Lc2: throw r8 // Catch: java.lang.Throwable -> Lc3 Lc3: r8 = move-exception c7.b.d() throw r8 */ throw new UnsupportedOperationException("Method not decompiled: o6.c.a(h6.h, java.io.File, e6.j):boolean"); } }