diff --git a/core/data/src/main/java/ru/tech/imageresizershrinker/core/data/image/utils/SimpleCompressor.kt b/core/data/src/main/java/ru/tech/imageresizershrinker/core/data/image/utils/SimpleCompressor.kt index 8d848d438f..897a832c9d 100644 --- a/core/data/src/main/java/ru/tech/imageresizershrinker/core/data/image/utils/SimpleCompressor.kt +++ b/core/data/src/main/java/ru/tech/imageresizershrinker/core/data/image/utils/SimpleCompressor.kt @@ -437,7 +437,7 @@ internal abstract class SimpleCompressor { }, compressionOption = JxlCompressionOption.LOSSY, quality = jxlQuality.qualityValue, - effort = JxlEffort.entries.first { it.ordinal == jxlQuality.effort }, + effort = JxlEffort.entries.first { it.ordinal == jxlQuality.effort - 1 }, decodingSpeed = JxlDecodingSpeed.entries.first { it.ordinal == jxlQuality.speed } ) } @@ -462,7 +462,7 @@ internal abstract class SimpleCompressor { }, compressionOption = JxlCompressionOption.LOSSLESS, quality = 100, - effort = JxlEffort.entries.first { it.ordinal == jxlQuality.effort }, + effort = JxlEffort.entries.first { it.ordinal == jxlQuality.effort - 1 }, decodingSpeed = JxlDecodingSpeed.entries.first { it.ordinal == jxlQuality.speed } ) } diff --git a/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/ImageFormat.kt b/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/ImageFormat.kt index 284793da73..f988c643ed 100644 --- a/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/ImageFormat.kt +++ b/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/ImageFormat.kt @@ -193,7 +193,7 @@ sealed class ImageFormat( data object Lossless : Jxl( title = "JXL Lossless", compressionTypes = listOf( - CompressionType.Effort(0..9) + CompressionType.Effort(1..10) ) ) @@ -201,7 +201,7 @@ sealed class ImageFormat( title = "JXL Lossy", compressionTypes = listOf( CompressionType.Quality(1..100), - CompressionType.Effort(0..9) + CompressionType.Effort(1..10) ) ) } diff --git a/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/Quality.kt b/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/Quality.kt index 58d6e98468..ea0fb3e961 100644 --- a/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/Quality.kt +++ b/core/domain/src/main/kotlin/ru/tech/imageresizershrinker/core/domain/image/model/Quality.kt @@ -30,7 +30,7 @@ sealed class Quality( val value = this as? Jxl ?: return Jxl(qualityValue.coerceIn(1..100)) value.copy( qualityValue = qualityValue.coerceIn(1..100), - effort = effort.coerceIn(0..9), + effort = effort.coerceIn(1..10), speed = speed.coerceIn(0..4) ) } @@ -71,7 +71,7 @@ sealed class Quality( data class Jxl( @IntRange(from = 1, to = 100) override val qualityValue: Int = 50, - @IntRange(from = 0, to = 9) + @IntRange(from = 1, to = 10) val effort: Int = 5, @IntRange(from = 0, to = 4) val speed: Int = 0, diff --git a/core/ui/src/main/kotlin/ru/tech/imageresizershrinker/core/ui/widget/controls/selection/QualitySelector.kt b/core/ui/src/main/kotlin/ru/tech/imageresizershrinker/core/ui/widget/controls/selection/QualitySelector.kt index 3d572a1f78..17631799e3 100644 --- a/core/ui/src/main/kotlin/ru/tech/imageresizershrinker/core/ui/widget/controls/selection/QualitySelector.kt +++ b/core/ui/src/main/kotlin/ru/tech/imageresizershrinker/core/ui/widget/controls/selection/QualitySelector.kt @@ -216,7 +216,7 @@ fun QualitySelector( Text( text = stringResource( R.string.speed_sub, - 0, 5 + 0, 4 ), fontSize = 12.sp, textAlign = TextAlign.Center,