Fix "download image" button

Issue #700
This commit is contained in:
N-Pex 2025-11-03 17:45:47 +01:00
parent bcfece378b
commit acb10a2662
2 changed files with 7 additions and 3 deletions

View file

@ -10,7 +10,7 @@
<C2PAInfo :proof="attachment?.proof" :metadata="attachment?.mediaMetadata" :interventionFlags="attachment?.mediaInterventionFlags" :metaStripped="metaStripped" /> <C2PAInfo :proof="attachment?.proof" :metadata="attachment?.mediaMetadata" :interventionFlags="attachment?.mediaInterventionFlags" :metaStripped="metaStripped" />
</div> </div>
</div> </div>
<v-btn variant="flat" block class="attachment-info__download-button" @click.stop="() => {}"> <v-btn variant="flat" block class="attachment-info__download-button" @click.stop="() => {emits('download');}">
<v-icon color="white" class="mr-2">$vuetify.icons.ic_download</v-icon>{{ $t("cc.download_image") }} <v-icon color="white" class="mr-2">$vuetify.icons.ic_download</v-icon>{{ $t("cc.download_image") }}
</v-btn> </v-btn>
</div> </div>
@ -30,10 +30,14 @@ const { attachment } = defineProps<{
const loadingProof: Ref<boolean> = ref(false); const loadingProof: Ref<boolean> = ref(false);
const metaStripped: Ref<boolean> = ref(false); const metaStripped: Ref<boolean> = ref(false);
const emits = defineEmits<{
(event: "download"): void;
}>();
const updateMetaStripped = (a: EventAttachment | undefined) => { const updateMetaStripped = (a: EventAttachment | undefined) => {
const hadC2PA = a?.mediaInterventionFlags ? a.mediaInterventionFlags.containsC2PA : false; const hadC2PA = a?.mediaInterventionFlags ? a.mediaInterventionFlags.containsC2PA : false;
const hadExif = a?.mediaInterventionFlags ? a.mediaInterventionFlags.containsEXIF : false; const hadExif = a?.mediaInterventionFlags ? a.mediaInterventionFlags.containsEXIF : false;
metaStripped.value = (hadC2PA && a?.proof?.integrity?.c2pa === undefined) || (hadExif && a?.proof?.integrity?.exif === undefined); metaStripped.value = (!!hadC2PA && a?.proof?.integrity?.c2pa === undefined) || (!!hadExif && a?.proof?.integrity?.exif === undefined);
}; };
onMounted(() => { onMounted(() => {

View file

@ -41,7 +41,7 @@
</v-card-title> </v-card-title>
<v-card-title class="d-flex"> </v-card-title> <v-card-title class="d-flex"> </v-card-title>
<v-card-text> <v-card-text>
<EventAttachmentInfo :attachment="currentAttachment" /> <EventAttachmentInfo :attachment="currentAttachment" v-on:download="downloadOne" />
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-bottom-sheet> </v-bottom-sheet>