package com.webtoonviewer.utils

import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import java.io.IOException

fun loadImgFromAssets(context: Context, fileName: String): Bitmap? {
    val assetManager = context.assets
    var bitmap: Bitmap? = null
    try {
        val inputStream = assetManager.open(fileName)
        bitmap = BitmapFactory.decodeStream(inputStream)
    } catch (e: IOException) {
        e.printStackTrace()
    }
    return bitmap
}