fix: 去除拼图maxCellDimension=800上限,直接使用原图尺寸×缩放因子
This commit is contained in:
Binary file not shown.
@@ -232,7 +232,6 @@ object ImageProcessor {
|
|||||||
val rows = layoutType.rows
|
val rows = layoutType.rows
|
||||||
|
|
||||||
val cellSpacing = 16
|
val cellSpacing = 16
|
||||||
val maxCellDimension = 800
|
|
||||||
|
|
||||||
// 根据第一张图片的原始尺寸确定单元格宽高比
|
// 根据第一张图片的原始尺寸确定单元格宽高比
|
||||||
val firstBitmap = images.firstOrNull()?.let { tryLoadBitmap(context, it) }
|
val firstBitmap = images.firstOrNull()?.let { tryLoadBitmap(context, it) }
|
||||||
@@ -242,17 +241,11 @@ object ImageProcessor {
|
|||||||
Pair(1, 1)
|
Pair(1, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 基准单元格大小(限制不超过maxCellDimension)
|
// 原图尺寸 × 质量缩放因子
|
||||||
val longer = maxOf(srcW, srcH)
|
val cellWidth = (srcW * quality.scaleFactor).toInt().coerceAtLeast(1)
|
||||||
val baseScale = if (longer > maxCellDimension) maxCellDimension.toFloat() / longer else 1.0f
|
val cellHeight = (srcH * quality.scaleFactor).toInt().coerceAtLeast(1)
|
||||||
val baseCellWidth = (srcW * baseScale).toInt()
|
|
||||||
val baseCellHeight = (srcH * baseScale).toInt()
|
|
||||||
|
|
||||||
// 根据质量等级缩放
|
val outputWidth = cellWidth * cols + cellSpacing * (cols + 1)
|
||||||
val cellWidth = (baseCellWidth * quality.scaleFactor).toInt().coerceAtLeast(1)
|
|
||||||
val cellHeight = (baseCellHeight * quality.scaleFactor).toInt().coerceAtLeast(1)
|
|
||||||
|
|
||||||
val outputWidth = (cellWidth * cols + cellSpacing * (cols + 1)).coerceAtLeast(480)
|
|
||||||
|
|
||||||
// 底部文字区域高度 - 动态计算
|
// 底部文字区域高度 - 动态计算
|
||||||
val textAreaHeight = if (bottomTitle.isNotBlank() || bottomContent.isNotBlank()) {
|
val textAreaHeight = if (bottomTitle.isNotBlank() || bottomContent.isNotBlank()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user