.class public Lt3/b;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lk3/g;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lk3/g<",
        "Landroid/graphics/Bitmap;",
        ">;"
    }
.end annotation


# static fields
.field public static final s:Lk3/d;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lk3/d<",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field public static final t:Lk3/d;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lk3/d<",
            "Landroid/graphics/Bitmap$CompressFormat;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field public final r:Ln3/b;


# direct methods
.method public static constructor <clinit>()V
    .registers 4

    const/16 v0, 0x5a

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    const-string v1, "com.bumptech.glide.load.resource.bitmap.BitmapEncoder.CompressionQuality"

    invoke-static {v1, v0}, Lk3/d;->a(Ljava/lang/String;Ljava/lang/Object;)Lk3/d;

    move-result-object v0

    sput-object v0, Lt3/b;->s:Lk3/d;

    .line 1
    new-instance v0, Lk3/d;

    sget-object v1, Lk3/d;->e:Lk3/d$b;

    const/4 v2, 0x0

    const-string v3, "com.bumptech.glide.load.resource.bitmap.BitmapEncoder.CompressionFormat"

    invoke-direct {v0, v3, v2, v1}, Lk3/d;-><init>(Ljava/lang/String;Ljava/lang/Object;Lk3/d$b;)V

    .line 2
    sput-object v0, Lt3/b;->t:Lk3/d;

    return-void
.end method

.method public constructor <init>(Ln3/b;)V
    .registers 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lt3/b;->r:Ln3/b;

    return-void
.end method


# virtual methods
.method public c(Ljava/lang/Object;Ljava/io/File;Lk3/e;)Z
    .registers 12

    check-cast p1, Lm3/w;

    const-string v0, "BitmapEncoder"

    .line 1
    invoke-interface {p1}, Lm3/w;->get()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/graphics/Bitmap;

    .line 2
    sget-object v1, Lt3/b;->t:Lk3/d;

    invoke-virtual {p3, v1}, Lk3/e;->c(Lk3/d;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/graphics/Bitmap$CompressFormat;

    if-eqz v1, :cond_15

    goto :goto_20

    :cond_15
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->hasAlpha()Z

    move-result v1

    if-eqz v1, :cond_1e

    sget-object v1, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    goto :goto_20

    :cond_1e
    sget-object v1, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    .line 3
    :goto_20
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    :try_start_26
    sget v2, Lg4/f;->b:I

    .line 4
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtimeNanos()J

    move-result-wide v2

    .line 5
    sget-object v4, Lt3/b;->s:Lk3/d;

    invoke-virtual {p3, v4}, Lk3/e;->c(Lk3/d;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/Integer;

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v4
    :try_end_38
    .catchall {:try_start_26 .. :try_end_38} :catchall_c3

    const/4 v5, 0x0

    const/4 v6, 0x0

    :try_start_3a
    new-instance v7, Ljava/io/FileOutputStream;

    invoke-direct {v7, p2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_3f
    .catch Ljava/io/IOException; {:try_start_3a .. :try_end_3f} :catch_5c
    .catchall {:try_start_3a .. :try_end_3f} :catchall_5a

    :try_start_3f
    iget-object p2, p0, Lt3/b;->r:Ln3/b;

    if-eqz p2, :cond_4c

    new-instance p2, Lcom/bumptech/glide/load/data/c;

    iget-object v6, p0, Lt3/b;->r:Ln3/b;

    invoke-direct {p2, v7, v6}, Lcom/bumptech/glide/load/data/c;-><init>(Ljava/io/OutputStream;Ln3/b;)V
    :try_end_4a
    .catch Ljava/io/IOException; {:try_start_3f .. :try_end_4a} :catch_57
    .catchall {:try_start_3f .. :try_end_4a} :catchall_55

    move-object v6, p2

    goto :goto_4d

    :cond_4c
    move-object v6, v7

    :goto_4d
    :try_start_4d
    invoke-virtual {p1, v1, v4, v6}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    invoke-virtual {v6}, Ljava/io/OutputStream;->close()V
    :try_end_53
    .catch Ljava/io/IOException; {:try_start_4d .. :try_end_53} :catch_5c
    .catchall {:try_start_4d .. :try_end_53} :catchall_5a

    const/4 v5, 0x1

    goto :goto_6b

    :catchall_55
    move-exception p1

    goto :goto_bd

    :catch_57
    move-exception p2

    move-object v6, v7

    goto :goto_5d

    :catchall_5a
    move-exception p1

    goto :goto_bc

    :catch_5c
    move-exception p2

    :goto_5d
    const/4 v4, 0x3

    :try_start_5e
    invoke-static {v0, v4}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v4

    if-eqz v4, :cond_69

    const-string v4, "Failed to encode Bitmap"

    invoke-static {v0, v4, p2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_69
    .catchall {:try_start_5e .. :try_end_69} :catchall_5a

    :cond_69
    if-eqz v6, :cond_6e

    :goto_6b
    :try_start_6b
    invoke-virtual {v6}, Ljava/io/OutputStream;->close()V
    :try_end_6e
    .catch Ljava/io/IOException; {:try_start_6b .. :try_end_6e} :catch_6e
    .catchall {:try_start_6b .. :try_end_6e} :catchall_c3

    :catch_6e
    :cond_6e
    const/4 p2, 0x2

    :try_start_6f
    invoke-static {v0, p2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p2

    if-eqz p2, :cond_bb

    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Compressed with type: "

    invoke-virtual {p2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    const-string v1, " of size "

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {p1}, Lg4/j;->d(Landroid/graphics/Bitmap;)I

    move-result v1

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, " in "

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {v2, v3}, Lg4/f;->a(J)D

    move-result-wide v1

    invoke-virtual {p2, v1, v2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    const-string v1, ", options format: "

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    sget-object v1, Lt3/b;->t:Lk3/d;

    invoke-virtual {p3, v1}, Lk3/e;->c(Lk3/d;)Ljava/lang/Object;

    move-result-object p3

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    const-string p3, ", hasAlpha: "

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->hasAlpha()Z

    move-result p1

    invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {v0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_bb
    .catchall {:try_start_6f .. :try_end_bb} :catchall_c3

    :cond_bb
    return v5

    :goto_bc
    move-object v7, v6

    :goto_bd
    if-eqz v7, :cond_c2

    :try_start_bf
    invoke-virtual {v7}, Ljava/io/OutputStream;->close()V
    :try_end_c2
    .catch Ljava/io/IOException; {:try_start_bf .. :try_end_c2} :catch_c2
    .catchall {:try_start_bf .. :try_end_c2} :catchall_c3

    :catch_c2
    :cond_c2
    :try_start_c2
    throw p1
    :try_end_c3
    .catchall {:try_start_c2 .. :try_end_c3} :catchall_c3

    :catchall_c3
    move-exception p1

    throw p1
.end method

.method public f(Lk3/e;)Lcom/bumptech/glide/load/c;
    .registers 2

    sget-object p1, Lcom/bumptech/glide/load/c;->s:Lcom/bumptech/glide/load/c;

    return-object p1
.end method
