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

JPEG encoding is incorrect #2188

Closed
nashaofu opened this issue Mar 27, 2024 · 2 comments
Closed

JPEG encoding is incorrect #2188

nashaofu opened this issue Mar 27, 2024 · 2 comments

Comments

@nashaofu
Copy link

Save as JPEG does not meet the expectations.

Expected

Expect the image to display correctly

Actual behaviour

Image encoding error

Reproduction steps

Provide source code, a repository link, or steps

use image;

fn main() {
    let im = image::open("input.png").unwrap();
    im.save("output.jpeg").unwrap();
}
  • input.png
    input
  • output.jpeg
    output
@gucki
Copy link

gucki commented Mar 27, 2024

Thank you @nashaofu! After reading through other issues, it seems to be a duplicate of #2173. Converting it to a DynamicImage, then to_rgb8, and then saving it as JPG works as expected.

@nashaofu
Copy link
Author

Get

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

No branches or pull requests

2 participants