diff --git a/CHANGELOG.md b/CHANGELOG.md index a11209d61..8408701a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.23.2] - 2026-02-14 + +- **FLAC**: + - Fix duplicate `Last-metadata-block` flags in the presence of PADDING blocks ([issue](https://github.com/Serial-ATA/lofty-rs/issues/607)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/609)) + - Ignore ID3v2 tags when not stripped during write ([issue](https://github.com/Serial-ATA/lofty-rs/issues/608)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/609)) + - Previously, the Vorbis Comments writer assumed that the ID3v2 tag had already been stripped. + If that wasn't the case, it would error that it couldn't find the FLAC stream marker. + ## [0.23.1] - 2026-02-08 ### Fixed diff --git a/lofty/src/flac/write.rs b/lofty/src/flac/write.rs index 75bb366d6..6c4a4e358 100644 --- a/lofty/src/flac/write.rs +++ b/lofty/src/flac/write.rs @@ -2,6 +2,7 @@ use super::block::{BLOCK_ID_PADDING, BLOCK_ID_PICTURE, BLOCK_ID_VORBIS_COMMENTS, use super::read::verify_flac; use crate::config::WriteOptions; use crate::error::{LoftyError, Result}; +use crate::id3::{FindId3v2Config, find_id3v2}; use crate::macros::{err, try_vec}; use crate::ogg::tag::VorbisCommentsRef; use crate::picture::{Picture, PictureInformation}; @@ -76,6 +77,9 @@ where let mut cursor = Cursor::new(file_bytes); + // We don't actually need the ID3v2 tag, but reading it will seek to the end of it if it exists + find_id3v2(&mut cursor, FindId3v2Config::NO_READ_TAG)?; + let stream_info = verify_flac(&mut cursor)?; let stream_info_start = stream_info.start as usize; let stream_info_end = stream_info.end as usize; @@ -135,6 +139,7 @@ where // `PADDING` always goes last last_block_replaced = true; + last_block_location = LastBlock::Padding; let mut padding_block = Block::new_padding(preferred_padding as usize)?; padding_block.last = true;