mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Prefixed JSON filenames with the image UUID #6469
This commit is contained in:
parent
ff01ceae99
commit
52aac954c0
@ -32,8 +32,9 @@ const DataViewer = (props: Props) => {
|
|||||||
const handleDownload = useCallback(() => {
|
const handleDownload = useCallback(() => {
|
||||||
const blob = new Blob([dataString]);
|
const blob = new Blob([dataString]);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
|
const imageName = fileName ? fileName.replace('.png', '') : null;
|
||||||
a.href = URL.createObjectURL(blob);
|
a.href = URL.createObjectURL(blob);
|
||||||
a.download = `${fileName || label}.json`;
|
a.download = imageName ? `${ imageName }_${ label }.json` : `${ label }.json`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
|
@ -68,14 +68,14 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => {
|
|||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
{metadata ? (
|
{metadata ? (
|
||||||
<DataViewer data={metadata} label={t('metadata.metadata')} />
|
<DataViewer fileName={image.image_name} data={metadata} label={t('metadata.metadata')} />
|
||||||
) : (
|
) : (
|
||||||
<IAINoContentFallback label={t('metadata.noMetaData')} />
|
<IAINoContentFallback label={t('metadata.noMetaData')} />
|
||||||
)}
|
)}
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
{image ? (
|
{image ? (
|
||||||
<DataViewer data={image} label={t('metadata.imageDetails')} />
|
<DataViewer fileName={image.image_name} data={image} label={t('metadata.imageDetails')} />
|
||||||
) : (
|
) : (
|
||||||
<IAINoContentFallback label={t('metadata.noImageDetails')} />
|
<IAINoContentFallback label={t('metadata.noImageDetails')} />
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user