Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yunyh committed Nov 9, 2024
1 parent 2031108 commit b811e9c
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.airbnb.lottie.compose

import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Typeface
import android.util.Base64
Expand Down Expand Up @@ -238,15 +239,18 @@ private fun maybeLoadImageFromAsset(
Logger.warning("Unable to open asset.", e)
return
}
try {
val bitmap: Bitmap? = try {
val opts = BitmapFactory.Options()
opts.inScaled = true
opts.inDensity = 160
var bitmap = BitmapFactory.decodeStream(inputStream, null, opts)
bitmap = Utils.resizeBitmapIfNeeded(bitmap, asset.width, asset.height)
asset.bitmap = bitmap
BitmapFactory.decodeStream(inputStream, null, opts)
} catch (e: IllegalArgumentException) {
Logger.warning("Unable to decode image.", e)
null
}

if (bitmap != null) {
asset.bitmap = Utils.resizeBitmapIfNeeded(bitmap, asset.width, asset.height)
}
}

Expand Down

0 comments on commit b811e9c

Please sign in to comment.