nashaofu / xcap

XCap is a cross-platform screen capture library written in Rust. It supports Linux (X11, Wayland), MacOS, and Windows. XCap supports screenshot and video recording (to be implemented).
https://docs.rs/xcap
Apache License 2.0
459 stars 55 forks source link

Saving screenshot as JPEG only produces garbage #114

Closed gucki closed 5 months ago

gucki commented 5 months ago

This works as expected:

    image
        .save(format!("monitor-{}.png", normalized(monitor.name())))
        .unwrap();

This produces a completely broken JPEG file:

    image
        .save(format!("monitor-{}.jpg", normalized(monitor.name())))
        .unwrap();

I'm crosscompiling from linux to windows using cargo build --target x86_64-pc-windows-gnu.

nashaofu commented 5 months ago

This should be a bug in crate image,https://github.com/image-rs/image/issues/2188