taglib-ruby icon indicating copy to clipboard operation
taglib-ruby copied to clipboard

Writing chapter mark images produces ID3 issues

Open spiderpug opened this issue 2 years ago • 1 comments

I'm trying to use the Gem to write chapter marks to MP3. These chapter marks may also contain images.

I created a simple repository to demonstrate what I'm doing:

https://github.com/spiderpug/taglib-chapter-mark-images-minimal

Expectation

ffprobe output.mp3 should show the chapter marks.

Actual

ffprobe does not detect any chapter marks.

I was able to nail it down to the usage of chapter_frame.add_embedded_frame. If any of those frames (TIT2, APIC) contains more than ~120 bytes of data, the written tag size is incorrect.

To reproduce how it should look like in ffprobe, replace data['image_data'] = File.read('chap.jpg') with data['image_data'] = 'abcd'. Then the chapter marks can be read correctly.

Do I have the wrong logic to begin with?

spiderpug avatar Jul 21 '22 14:07 spiderpug

This may be a taglib question rather than a taglib-ruby question. Does the thing you want to do work when you call taglib from C++?

Jacob Vosmaer

On 21 Jul 2022, at 16:45, Robert Wachs @.***> wrote:

 I'm trying to use the Gem to write chapter marks to MP3. These chapter marks may also contain images.

I created a simple repository to demonstrate what I'm doing:

https://github.com/spiderpug/taglib-chapter-mark-images-minimal

Expectation

ffprobe output.mp3 should show the chapter marks.

Actual

ffprobe does not detect any chapter marks.

I was able to nail it down to the usage of chapter_frame.add_embedded_frame. If any of those frames (TIT2, APIC) contains more than ~120 bytes of data, the written tag size is incorrect.

To reproduce how it should look like in ffprobe, replace data['image_data'] = File.read('chap.jpg') with data['image_data'] = 'abcd'. Then the chapter marks can be read correctly.

Do I have the wrong logic to begin with?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

jacobvosmaer avatar Jul 21 '22 15:07 jacobvosmaer