Skip to content

Commit

Permalink
fix(api): use correct case for PNG metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Aug 2, 2023
1 parent ea99094 commit dc9048c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions api/onnx_web/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def save_image(
exif = PngImagePlugin.PngInfo()

if params is not None:
exif.add_text("Make", "onnx-web")
exif.add_text("make", "onnx-web")
exif.add_text(
"Maker Note",
"maker note",
dumps(
json_params(
[output],
Expand All @@ -217,9 +217,9 @@ def save_image(
)
),
)
exif.add_text("Model", server.server_version)
exif.add_text("model", server.server_version)
exif.add_text(
"Parameters",
"parameters",
str_params(server, params, size, inversions=inversions, loras=loras),
)

Expand Down
2 changes: 1 addition & 1 deletion gui/src/components/Profiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export function downloadParamsAsFile(data: DeepPartial<ImageMetadata>): void {
export async function parseImageParams(file: File): Promise<DeepPartial<ImageMetadata>> {
const tags = await ExifReader.load(file);

// handle lowercase variation from my earlier mistakes
// some parsers expect uppercase, some use lowercase, read both
const makerNote = decodeTag(defaultTo(tags.MakerNote, tags['maker note']));
// eslint-disable-next-line dot-notation, @typescript-eslint/strict-boolean-expressions
const userComment = decodeTag(defaultTo(defaultTo(tags.UserComment, tags['Parameters']), tags['parameters']));
Expand Down

0 comments on commit dc9048c

Please sign in to comment.