Commit dae24d24 authored by Dazzle Wu's avatar Dazzle Wu

fix: 视频数字人图片比例

parent 62d36952
import { ScreenType } from './creation'
export enum TemplateType {
FINANCIAL_MARKETING = 'FINANCIAL_MARKETING', // 理財營銷
EDUCATION_LEARNING = 'EDUCATION_LEARNING', // 教育學習
......@@ -41,6 +43,7 @@ export interface DigitalTemplate {
width: number
height: number
transparent: boolean
pageLayout: ScreenType
} | null
dhParams: {
cameraId: number | null
......
......@@ -22,7 +22,7 @@ const digitalCreationStore = useDigitalCreationStore()
:class="digitalCreationStore.figureId === value.figureId ? 'border-blue' : 'border-transparent'"
@click="emit('click', value)"
>
<img :src="value.imageUrl" class="h-full w-full" />
<img :src="value.imageUrl" class="h-full w-full object-cover" />
<div class="absolute bottom-0 h-5 w-full bg-gradient-to-t from-gray-600 px-1 text-xs leading-5 text-white">
{{ value.imageName }}
</div>
......
......@@ -157,7 +157,7 @@ function controlAudio() {
<img
v-if="digitalCreationStore.inputImageUrl"
:src="digitalCreationStore.inputImageUrl"
class="absolute max-w-none object-contain"
class="absolute max-w-none object-cover"
:style="{
width: `${digitalHumanWidth}px`,
height: `${digitalHumanHeight}px`,
......
......@@ -3,7 +3,7 @@ import { fetchDraftConfigById } from '@/apis/digital-creation'
import { fetchGetTaskConfig } from '@/apis/opus'
import { fetchDigitalHumanTemplateStatus } from '@/apis/template'
import { useDigitalCreationStore } from '@/store/modules/creation'
import { DraftConfig } from '@/store/types/creation'
import { DraftConfig, ScreenType } from '@/store/types/creation'
import { DigitalTemplate } from '@/store/types/template'
import { formatDateTime } from '@/utils/date-formatter'
import { onMounted } from 'vue'
......@@ -53,9 +53,13 @@ async function getDigitalTemplate(id: string) {
height: digitalTemplate.videoParams?.height || digitalCreationStore.height,
cameraId: digitalTemplate.dhParams?.cameraId || null,
x: digitalTemplate.dhParams?.position.x || digitalCreationStore.x,
w: digitalTemplate.dhParams?.position.w || digitalCreationStore.w,
w:
digitalTemplate.dhParams?.position.w ||
(digitalTemplate.videoParams?.pageLayout === ScreenType.LANDSCAPE ? 607 : 1080),
y: digitalTemplate.dhParams?.position.y || digitalCreationStore.y,
h: digitalTemplate.dhParams?.position.h || digitalCreationStore.h,
h:
digitalTemplate.dhParams?.position.h ||
(digitalTemplate.videoParams?.pageLayout === ScreenType.LANDSCAPE ? 1080 : 1920),
subtitlePolicy: digitalTemplate.subtitleParams?.subtitlePolicy || digitalCreationStore.subtitlePolicy,
enabled: digitalTemplate.subtitleParams?.enabled ? 'Y' : 'N',
backgroundImageUrl: digitalTemplate.backgroundImageUrl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment