Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reencode images to store exif data #25

Merged
merged 1 commit into from
Apr 5, 2023
Merged

Conversation

JeLuF
Copy link
Contributor

@JeLuF JeLuF commented Mar 31, 2023

Fixes easydiffusion/easydiffusion#1080

When embedding metadata, the current version of sdkit re-encodes the image, without obeying the encoder's quality setting. Using piexif.insert(), it's possible to embedd metadata without re-encoding the image.

Current version, JPG, Q=95%, no embedded metadata, 107KB

a_photograph_of_an_astronaut_riding_a_horse_F7JKORE0

Current version, JPG, Q=95, with embedded metadata, 42KB

a_photograph_of_an_astronaut_riding_a_horse_F7JY7WT0

New version, JPG, Q=95, with embedded metadata, 108KB

a_photograph_of_an_astronaut_riding_a_horse_F7M6O8F0

@cmdr2 cmdr2 merged commit d6b0702 into easydiffusion:main Apr 5, 2023
@cmdr2
Copy link
Contributor

cmdr2 commented Apr 5, 2023

Thanks!

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.

Image auto-saving doesn't obey the image quality parameter and there might be double quality conversion
2 participants