Update app.js

This is the way to generate the type 2 exif tag 37510 that you want to import json from a webp/jpeg:
```
    exif = img.getexif()
    dump = json.dumps(metadata)
    exif[ExifTags.Base.UserComment] = json.dumps(metadata)
    exif_dat = exif.tobytes()
    img.save(image_path, exif=exif_dat)
```
In doing so, you cannot import the unicode json embedded the way pnginfo reads the webp. pnginfo.js also will be modified.
This commit is contained in:
Eric 2024-05-06 19:30:36 -07:00 committed by GitHub
parent c61eadf69a
commit 4f2f332622
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2099,16 +2099,16 @@ export class ComfyApp {
}
}
} else if (file.type === "image/webp") {
const pngInfo = await getWebpMetadata(file);
const pngInfo = await getWebpMetadata(file); // getWebpMetadata returns parsed JSON, so much simpler
if (pngInfo) {
if (pngInfo.workflow) {
this.loadGraphData(JSON.parse(pngInfo.workflow));
this.loadGraphData(pngInfo.workflow);
} else if (pngInfo.Workflow) {
this.loadGraphData(JSON.parse(pngInfo.Workflow)); // Support loading workflows from that webp custom node.
this.loadGraphData(pngInfo.Workflow); // Support loading workflows from that webp custom node.
} else if (pngInfo.prompt) {
this.loadApiJson(JSON.parse(pngInfo.prompt));
this.loadApiJson(pngInfo.prompt);
} else if (pngInfo.Prompt) {
this.loadApiJson(JSON.parse(pngInfo.Prompt)); // Support loading prompts from that webp custom node.
this.loadApiJson(pngInfo.Prompt); // Support loading prompts from that webp custom node.
}
}
} else if (file.type === "application/json" || file.name?.endsWith(".json")) {