diff --git a/commons/build.gradle.kts b/commons/build.gradle.kts index db9854f3e..b09b80c91 100644 --- a/commons/build.gradle.kts +++ b/commons/build.gradle.kts @@ -113,6 +113,7 @@ dependencies { implementation(libs.bundles.lifecycle) implementation(libs.bundles.compose) implementation(libs.compose.view.binding) + implementation(libs.jxl.integration) debugImplementation(libs.bundles.compose.preview) api(libs.joda.time) diff --git a/commons/src/main/kotlin/org/fossify/commons/dialogs/PropertiesDialog.kt b/commons/src/main/kotlin/org/fossify/commons/dialogs/PropertiesDialog.kt index d0bed5843..670583edc 100644 --- a/commons/src/main/kotlin/org/fossify/commons/dialogs/PropertiesDialog.kt +++ b/commons/src/main/kotlin/org/fossify/commons/dialogs/PropertiesDialog.kt @@ -17,6 +17,8 @@ import org.fossify.commons.views.MyTextView import java.io.File import java.io.InputStream import java.util.* +import com.awxkee.jxlcoder.JxlCoder +import android.graphics.Point class PropertiesDialog : BasePropertiesDialog { private var mCountHiddenItems = false @@ -143,7 +145,23 @@ class PropertiesDialog : BasePropertiesDialog { } fileDirItem.path.isImageSlow() -> { - fileDirItem.getResolution(mActivity)?.let { addProperty(R.string.resolution, it.formatAsResolution()) } + if(fileDirItem.name.endsWith(".jxl")) { + var jxlCode = JxlCoder + var size = jxlCode.getSize(File(fileDirItem.path).readBytes()) + if(size != null) { + var point = Point(size.width, size.height) + addProperty(R.string.resolution, point.formatAsResolution()) + } + + }else { + fileDirItem.getResolution(context = mActivity) + ?.let { + addProperty( + labelId = R.string.resolution, + value = it.formatAsResolution() + ) + } + } } fileDirItem.path.isAudioSlow() -> { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6e45cb7c6..22455fd39 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -52,6 +52,8 @@ app-build-targetSDK = "36" app-build-minimumSDK = "26" app-build-javaVersion = "VERSION_17" app-build-kotlinJVMTarget = "17" +#Other +jxlDecoder = "2.5.2" [libraries] #Android X androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } @@ -103,6 +105,8 @@ joda-time = { module = "joda-time:joda-time", version.ref = "jodaTime" } #Kotlin kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } kotlin-immutable-collections = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlin-immutable-collections" } +#Other +jxl-integration = { group = "io.github.awxkee", name = "jxl-coder-glide", version.ref = "jxlDecoder" } [bundles] compose = [ "compose-activity",