Skip to content

Keep embedded PngInfo metadata#2170

Merged
abidlabs merged 2 commits into
gradio-app:mainfrom
cobryan05:maintainPngInfo
Sep 5, 2022
Merged

Keep embedded PngInfo metadata#2170
abidlabs merged 2 commits into
gradio-app:mainfrom
cobryan05:maintainPngInfo

Conversation

@cobryan05
Copy link
Copy Markdown
Contributor

@cobryan05 cobryan05 commented Sep 2, 2022

Maintain any text-only PngInfo metadata on a PIL image when dragging UI images between components.

Description

Please include:

  • PNG images can have metadata attached to them. This data could, for example, be added during image generation and store the generation parameters. However, if dragging an annotated image between UI elements in Gradio, the conversion to base64 would lose the metadata
  • This change maintains the metadata when dragging PNGs between UI elements

Closes: # (issue)

Checklist:

  • I have performed a self-review of my own code
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (well, nothing new breaks)

Maintain any text-only PngInfo metadata on a PIL image when
dragging UI images between components.
@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Sep 5, 2022

Thank you so much for this contribution @cobryan05! Png metadata is very cool, and I'm glad to see that we now preserve it.

@abidlabs abidlabs merged commit b145a2a into gradio-app:main Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants