package com.kofax.mobile.sdk.w; import android.graphics.Bitmap; import bolts.CancellationToken; import com.kofax.BuildConfig; import com.kofax.kmc.ken.engines.data.Image; import com.kofax.mobile.sdk._internal.g; import com.kofax.mobile.sdk.extract.id.IIdImageProcessingListener; import o.InterfaceC13391fZD; /* loaded from: classes3.dex */ public class ai extends ae { private final a Qs; /* loaded from: classes3.dex */ public interface a { com.kofax.mobile.sdk.u.b B(com.kofax.mobile.sdk.e.a aVar); void a(IIdImageProcessingListener iIdImageProcessingListener, Image image); } @Override // com.kofax.mobile.sdk.w.ae, com.kofax.mobile.sdk.e.c public /* bridge */ /* synthetic */ void a(Object obj, CancellationToken cancellationToken) { super.a(obj, cancellationToken); } @InterfaceC13391fZD public ai(a aVar) { this.Qs = aVar; } @Override // com.kofax.mobile.sdk.w.ae public void a(com.kofax.mobile.sdk.e.a aVar) { IIdImageProcessingListener imageProcessingListener = aVar.getImageProcessingListener(); com.kofax.mobile.sdk.u.b B = this.Qs.B(aVar); if (imageProcessingListener == null || B == null) { return; } Image image = B.NW; g.a aVar2 = B.NX; Bitmap a2 = a(aVar2); if (a2 == null) { aVar2 = B.NV; a2 = a(aVar2); try { Image image2 = new Image(a2); try { Image.FriendI friendI = new Image.FriendI(image2, BuildConfig.APPLICATION_ID); friendI.setImageDPI(B.originalImage.getImageDPI()); friendI.setImageMetaData(B.originalImage.getImageMetaData()); } catch (Throwable unused) { } image = image2; } catch (Throwable unused2) { } } if (a2 == null || image == null) { return; } aVar2.i(false); this.Qs.a(imageProcessingListener, image); } private static Bitmap a(g.a aVar) { if (aVar == null) { return null; } return aVar.getBitmap(); } }