PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Integration: #5864 #5993 the DDS level cut-out test sets the level's row pitch
aiongg8e206e60b0eb
diff --git a/crates/codecs/tests/dds_write.rs b/crates/codecs/tests/dds_write.rsindex 3225dd14d..119101e4f 100644--- a/crates/codecs/tests/dds_write.rs+++ b/crates/codecs/tests/dds_write.rs@@ -97,6 +97,9 @@ fn level(file: &[u8], i: u32) -> Image {b[12..16].copy_from_slice(&(lh as u32).to_le_bytes());b[16..20].copy_from_slice(&(lw as u32).to_le_bytes());b[28..32].copy_from_slice(&1u32.to_le_bytes());+ // The pitch field is a row stride for uncompressed textures and the level size for BC.+ let pitch = if le32(file, 80) & DDPF_FOURCC != 0 { level_bytes(file, lw, lh) } else { lw * le32(file, 88) as usize / 8 };+ b[20..24].copy_from_slice(&(pitch as u32).to_le_bytes());b.extend(&file[start..start + level_bytes(file, lw, lh)]);decode(&b).unwrap()}