mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-20 22:27:04 +08:00
Update pnginfo.js
why parsing in text mode a json that's already clean? also what is the purpose of `let txt_chunks = {}`? do we expect more json chunks? like multiple exif tags? one for workflow and one for prompt?
no one will ever do that. we custom node dev do not have your specs to embedd the json as you want in webp/jpeg/avif.
We save the whole metadata in a single exif tag called UserComment, as everyone else.
Therefore, txt_chunks is unique, and contains a parsed json ready for use by app.js!
This commit is contained in:
parent
4f2f332622
commit
046f4ed09f
@ -128,12 +128,7 @@ export function getWebpMetadata(file) {
|
||||
if (String.fromCharCode(...webp.slice(offset + 8, offset + 8 + 6)) == "Exif\0\0") {
|
||||
offset += 6;
|
||||
}
|
||||
let data = parseExifData(webp.slice(offset + 8, offset + 8 + chunk_length));
|
||||
for (var key in data) {
|
||||
var value = data[key];
|
||||
let index = value.indexOf(':');
|
||||
txt_chunks[value.slice(0, index)] = value.slice(index + 1);
|
||||
}
|
||||
txt_chunks = parseExifData(webp.slice(offset + 8, offset + 8 + chunk_length)); // we get only 1 tag with the whole prompt already parsed
|
||||
}
|
||||
|
||||
offset += 8 + chunk_length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user