11package com.forjrking.lubankt
22
3+ import android.annotation.SuppressLint
34import android.app.Application
45import android.content.Context
5- import android.media.ExifInterface
6+ import android.os.Build
67import android.util.DisplayMetrics
78import android.util.Log
89import android.view.WindowManager
10+ import androidx.exifinterface.media.ExifInterface
911import com.forjrking.lubankt.io.BufferedInputStreamWrap
1012import com.forjrking.lubankt.parser.DefaultImgHeaderParser
11- import com.forjrking.lubankt.parser.ExifInterfaceImageHeaderParser
13+ import com.forjrking.lubankt.parser.ExifInterfaceImgHeaderParser
1214import com.forjrking.lubankt.parser.ImageType
1315import com.forjrking.lubankt.parser.ImgHeaderParser
1416import java.io.File
1517import java.io.IOException
1618import java.io.InputStream
1719import kotlin.jvm.Throws
18-
20+ /* *
21+ * @Des: 工具类的方法 内部持有Context通过反射获取的ApplicationContext
22+ * @Author: forjrking
23+ * @Time: 2021/6/18 6:23 下午
24+ * @Version: 1.0.0
25+ **/
26+ @SuppressLint(" StaticFieldLeak" )
1927internal object Checker {
2028
2129 // Right now we're only using this parser for HEIF images, which are only supported on OMR1+.
@@ -24,12 +32,14 @@ internal object Checker {
2432 mutableListOf<ImgHeaderParser >().apply {
2533 add(DefaultImgHeaderParser ())
2634 // 可以自定义新的解码器
27- add(ExifInterfaceImageHeaderParser ())
35+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O_MR1 ) {
36+ // 支持HEIF
37+ add(ExifInterfaceImgHeaderParser ())
38+ }
2839 }
2940 }
3041
3142 const val TAG = " Luban"
32-
3343 // 常用压缩比
3444 private const val DEFAULT_QUALITY = 66
3545 private const val DEFAULT_LOW_QUALITY = 60
0 commit comments