File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
static-avif/src/main/java/com/facebook/avifsupport Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com.facebook.avifsupport
2
2
3
3
import android.graphics.Bitmap
4
+ import android.util.Log
5
+ import com.facebook.common.logging.FLog
4
6
import com.facebook.imagepipeline.common.ImageDecodeOptions
5
7
import com.facebook.imagepipeline.decoder.ImageDecoder
6
8
import com.facebook.imagepipeline.image.CloseableImage
@@ -24,16 +26,17 @@ class AvifDecoder(private val bitmapPool: BitmapPool) : ImageDecoder {
24
26
25
27
val info = Info ()
26
28
if (! AvifDecoder .getInfo(byteBuffer, length, info)) {
29
+ FLog .e(TAG , " Error when getting Info from AvifDecoder" )
27
30
return null
28
31
}
29
32
30
33
val bitmap = getBitmap(info.width, info.height, options.bitmapConfig)
31
34
32
35
if (! AvifDecoder .decode(byteBuffer, byteBuffer.remaining(), bitmap)) {
36
+ FLog .e(TAG , " Error while decoding" )
33
37
return null
34
38
}
35
39
36
-
37
40
return CloseableStaticBitmap .of(
38
41
bitmap,
39
42
bitmapPool::release,
@@ -48,4 +51,8 @@ class AvifDecoder(private val bitmapPool: BitmapPool) : ImageDecoder {
48
51
bitmap.reconfigure(width, height, config)
49
52
}
50
53
}
54
+
55
+ companion object {
56
+ private const val TAG = " AvifDecoder"
57
+ }
51
58
}
You can’t perform that action at this time.
0 commit comments