package o; import android.graphics.ColorSpace; import android.graphics.ImageDecoder; import android.os.Build; import android.util.Log; import android.util.Size; /* renamed from: o.uQG, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C17158uQG implements ImageDecoder.OnHeaderDecodedListener { private final EnumC16061koj a; private final boolean b; private final QqG c; private final sTL d = sTL.d(); private final int e; private final RBw f; private final int g; /* JADX WARN: Removed duplicated region for block: B:19:0x007a */ /* JADX WARN: Removed duplicated region for block: B:23:0x0081 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public C17158uQG(int r2, int r3, o.unA r4) { /* r1 = this; r1.() o.sTL r0 = o.sTL.d() r1.d = r0 r1.g = r2 r1.e = r3 o.wrW r2 = o.NLP.c o.nyh, java.lang.Object> r3 = r4.d boolean r3 = r3.containsKey(r2) if (r3 == 0) goto L1e o.nyh, java.lang.Object> r3 = r4.d java.lang.Object r2 = r3.get(r2) goto L20 L1e: T r2 = r2.a L20: o.koj r2 = (o.EnumC16061koj) r2 r1.a = r2 o.wrW r2 = o.RBw.i o.nyh, java.lang.Object> r3 = r4.d boolean r3 = r3.containsKey(r2) if (r3 == 0) goto L35 o.nyh, java.lang.Object> r3 = r4.d java.lang.Object r2 = r3.get(r2) goto L37 L35: T r2 = r2.a L37: o.RBw r2 = (o.RBw) r2 r1.f = r2 o.wrW r2 = o.NLP.d o.nyh, java.lang.Object> r3 = r4.d boolean r3 = r3.containsKey(r2) if (r3 == 0) goto L4c o.nyh, java.lang.Object> r3 = r4.d java.lang.Object r2 = r3.get(r2) goto L4e L4c: T r2 = r2.a L4e: if (r2 == 0) goto L6d o.wrW r2 = o.NLP.d o.nyh, java.lang.Object> r3 = r4.d boolean r3 = r3.containsKey(r2) if (r3 == 0) goto L61 o.nyh, java.lang.Object> r3 = r4.d java.lang.Object r2 = r3.get(r2) goto L63 L61: T r2 = r2.a L63: java.lang.Boolean r2 = (java.lang.Boolean) r2 boolean r2 = r2.booleanValue() if (r2 == 0) goto L6d r2 = 1 goto L6e L6d: r2 = 0 L6e: r1.b = r2 o.wrW r2 = o.NLP.e o.nyh, java.lang.Object> r3 = r4.d boolean r3 = r3.containsKey(r2) if (r3 == 0) goto L81 o.nyh, java.lang.Object> r3 = r4.d java.lang.Object r2 = r3.get(r2) goto L83 L81: T r2 = r2.a L83: o.QqG r2 = (o.QqG) r2 r1.c = r2 return */ throw new UnsupportedOperationException("Method not decompiled: o.C17158uQG.(int, int, o.unA):void"); } @Override // android.graphics.ImageDecoder.OnHeaderDecodedListener public final void onHeaderDecoded(ImageDecoder imageDecoder, ImageDecoder.ImageInfo imageInfo, ImageDecoder.Source source) { if (this.d.e(this.g, this.e, this.b, false)) { imageDecoder.setAllocator(3); } else { imageDecoder.setAllocator(1); } if (this.a == EnumC16061koj.PREFER_RGB_565) { imageDecoder.setMemorySizePolicy(0); } imageDecoder.setOnPartialImageListener(new ImageDecoder.OnPartialImageListener(this) { // from class: o.uQG.1 private C17158uQG c; @Override // android.graphics.ImageDecoder.OnPartialImageListener public final boolean onPartialImage(ImageDecoder.DecodeException decodeException) { return false; } { this.c = this; } }); Size size = imageInfo.getSize(); int i = this.g; if (i == Integer.MIN_VALUE) { i = size.getWidth(); } int i2 = this.e; if (i2 == Integer.MIN_VALUE) { i2 = size.getHeight(); } float a = this.f.a(size.getWidth(), size.getHeight(), i, i2); int round = Math.round(size.getWidth() * a); int round2 = Math.round(size.getHeight() * a); if (Log.isLoggable("ImageDecoder", 2)) { size.getWidth(); size.getHeight(); } imageDecoder.setTargetSize(round, round2); if (this.c != null) { if (Build.VERSION.SDK_INT >= 28) { imageDecoder.setTargetColorSpace(ColorSpace.get((this.c == QqG.DISPLAY_P3 && imageInfo.getColorSpace() != null && imageInfo.getColorSpace().isWideGamut()) ? ColorSpace.Named.DISPLAY_P3 : ColorSpace.Named.SRGB)); } else { imageDecoder.setTargetColorSpace(ColorSpace.get(ColorSpace.Named.SRGB)); } } } }