Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lofty/src/flac/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down