Skip to content

Commit

Permalink
HARDWARE bitmap null (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwww-wwww committed Apr 20, 2024
1 parent e620608 commit b8e1b0e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class Decoder(
* @return The decoded region. It is safe to return null if decoding fails.
*/
override fun decodeRegion(sRect: Rect, sampleSize: Int): Bitmap {
var bitmap = decoder?.decode(sRect, sampleSize)
val bitmap = decoder?.decode(sRect, sampleSize)
if (Build.VERSION.SDK_INT >= 26) {
bitmap = bitmap?.copy(Bitmap.Config.HARDWARE, false)
bitmap?.copy(Bitmap.Config.HARDWARE, false)?.let { return it; }
}
return bitmap ?: error("Null region bitmap")
}
Expand Down

0 comments on commit b8e1b0e

Please sign in to comment.