Start on C2PA and Exif info boxes on upload

This commit is contained in:
N-Pex 2025-07-04 12:51:57 +02:00
parent 114c09eb50
commit 54a1c05ddf
14 changed files with 337 additions and 49 deletions

View file

@ -28,22 +28,35 @@
</div>
</div>
<C2PABadge :proof="attachment.proof" />
<C2PAInfo class="attachment-info__detail-box" v-if="hasC2PA" :c2pa="attachment.proof?.integrity?.c2pa" :ai-inference-result="attachment.proof?.ai?.inferenceResult" />
<EXIFInfo class="attachment-info__detail-box" v-if="hasExif" :exif="attachment.proof?.integrity?.exif" />
</div>
</template>
<script setup lang="ts">
import { Attachment } from "../../models/attachment";
import prettyBytes from "pretty-bytes";
import C2PABadge from "../c2pa/C2PABadge.vue";
import C2PAInfo from "../content-credentials/C2PAInfo.vue";
import EXIFInfo from "../content-credentials/EXIFInfo.vue";
import { useI18n } from "vue-i18n";
import { computed } from "vue";
const { t } = useI18n();
defineProps<{
const { attachment } = defineProps<{
attachment: Attachment;
}>();
//console.error("ATTACHMENT", attachment.proof);
const hasC2PA = computed(() => {
return attachment.proof?.integrity?.c2pa !== undefined;
});
const hasExif = computed(() => {
return attachment.proof?.integrity?.exif !== undefined;
});
const formatBytes = (bytes: number) => {
return prettyBytes(bytes);
};

View file

@ -214,14 +214,13 @@
import { defineComponent, reactive } from "vue";
import messageMixin from "../messages/messageMixin";
import { Attachment } from "../../models/attachment";
import C2PABadge from "../c2pa/C2PABadge.vue";
import { createUploadBatch } from "../../models/attachmentManager";
import AttachmentInfo from "./AttachmentInfo.vue";
import ThumbnailView from "./ThumbnailView.vue";
export default defineComponent({
mixins: [messageMixin],
components: { C2PABadge, AttachmentInfo, ThumbnailView },
components: { AttachmentInfo, ThumbnailView },
emits: ["pick-file", "close"],
props: {
defaultRootMessageText: {