The previous .git directory was found gutted (only info/ remained), so history is unrecoverable locally. This commit restores version control with the tree exactly as it stands: the working app, the preview-tracks launcher on the artist hero, the scrollable-track-previews design bundle (docs + approved mockups), and the Phase 0 validation artifacts.
27 lines
946 B
Rust
27 lines
946 B
Rust
//! Decode an image with the exact decoder the hero pipeline uses (the `image`
|
|
//! crate) and write lossless PNG. Lets the live-GPU hero prototype consume
|
|
//! bit-identical pixels to the baked path — browsers decode JPEG chroma
|
|
//! differently, which showed up as a subtle tint in A/B comparisons.
|
|
//!
|
|
//! Usage: decode_to_png <input.jpg> <output.png>
|
|
|
|
fn main() {
|
|
let mut args = std::env::args().skip(1);
|
|
let (Some(input), Some(output)) = (args.next(), args.next()) else {
|
|
eprintln!("usage: decode_to_png <input> <output.png>");
|
|
std::process::exit(2);
|
|
};
|
|
let bytes = std::fs::read(&input).expect("read input");
|
|
let decoded = image::load_from_memory(&bytes).expect("decode");
|
|
decoded
|
|
.save_with_format(&output, image::ImageFormat::Png)
|
|
.expect("write png");
|
|
println!(
|
|
"{} {}x{} -> {}",
|
|
input,
|
|
decoded.width(),
|
|
decoded.height(),
|
|
output
|
|
);
|
|
}
|