feat(app): banner crop ratio 3:1 -> 16:9 (output <=1920x1080, preview height aligned with cover)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-29 09:32:28 +08:00
parent bfba76b5e6
commit 19d4fd143a
+9 -6
View File
@@ -518,7 +518,8 @@ class _AlbumFormPageState extends ConsumerState<AlbumFormPage>
}
}
/// 选图后必经裁剪:宣传图 3:1(观众页横幅),输出宽 ≤2400。
/// 选图后必经裁剪:宣传图 16:9(观众页横幅,2026-09-29 由 3:1 调整),
/// 输出宽 ≤1920(1920×1080,与封面一致)。
Future<void> _pickBannerImage() async {
final path = await ref.read(singleImagePickerProvider)();
if (path == null || !mounted) {
@@ -528,8 +529,8 @@ class _AlbumFormPageState extends ConsumerState<AlbumFormPage>
MaterialPageRoute(
builder: (_) => ImageCropPage(
sourcePath: path,
aspectRatio: 3 / 1,
maxOutputWidth: 2400,
aspectRatio: 16 / 9,
maxOutputWidth: 1920,
),
),
);
@@ -538,7 +539,7 @@ class _AlbumFormPageState extends ConsumerState<AlbumFormPage>
}
}
/// 宣传图(banner)选择器:3:1 横幅可点击区域;编辑模式显示现有 banner。
/// 宣传图(banner)选择器:16:9 可点击区域(与封面同视觉高度);编辑模式显示现有 banner。
Widget _buildBannerPicker(AppLocalizations l10n) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -549,7 +550,9 @@ class _AlbumFormPageState extends ConsumerState<AlbumFormPage>
onTap: _submitting ? null : _pickBannerImage,
borderRadius: BorderRadius.circular(kRadiusInput),
child: Container(
height: 120,
// 与封面预览区同高(16:9 语义下的近似占位;实际裁剪比在
// _pickBannerImage 的 ImageCropPage 参数)。
height: 180,
width: double.infinity,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHighest,
@@ -619,7 +622,7 @@ class _AlbumFormPageState extends ConsumerState<AlbumFormPage>
_buildCoverPicker(l10n),
const SizedBox(height: kSpace16),
// ── 宣传图选择(3:1 横幅;编辑模式显示现有 banner)──
// ── 宣传图选择(16:9;编辑模式显示现有 banner)──
_buildBannerPicker(l10n),
const SizedBox(height: kSpace24),