Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
440 stars 60 forks source link

Save on file with ID3v2.4 tag leaves corrupt tag behind #231

Closed m0nkge closed 9 months ago

m0nkge commented 9 months ago

The problem

I have a few files with ID3v2.4 + v1 tags in them. When I save chapters, I get a new 2.3 tag followed by something that is reported as unknown by mp3diag. MP3Tag reports: ID3v2.3 ERROR: MP3 header parse error.

Environment

Details

The older version of the library, v4.36, removed 2.4 tag and replaced it with a v2.3.

Orig file with v2.4 tag: https://www.dropbox.com/s/dzwkyuotkh5pzma/James%2011-15.mp3?dl=0 File modified by ATL4.36.0: https://www.dropbox.com/s/a3x2oi128dfb76i/James%2011-15%20-%20Copy%20%28NET48%29.mp3?dl=0 File modified by ATL5.7.0: https://www.dropbox.com/s/wgn9favg7hknmou/James%2011-15%20-%20Copy%20%28NET6%29.mp3?dl=0

Code To Reproduce Issue [ Good To Have ]

Code is identical between the version of my app using ATL4.36 and 5.7

Zeugma440 commented 9 months ago

Thanks for your feedback as well as the sample files.

However, I cannot download from the last two links; only the first one does lead to a valid dropbox file. Could you check that please?

m0nkge commented 9 months ago

You are too fast! :) My upload speed is quite low. They just synced. Please try again.

m0nkge commented 9 months ago

In addition, I noticed that ATL5.7 is not loading the image from the ID3v2.4 original file. But ATL4.36 does!

I'm rechecking my code on this bit just in case I've missed something.

m0nkge commented 9 months ago

Re: image loading,

 Dim filePics As IList(Of PictureInfo) = theTrack.EmbeddedPictures

filePics.Count returns 0!

Zeugma440 commented 9 months ago

Thank you very much for the detailed information : all these issues were linked together.

I recently added a check inside the ID3v2 parser that considers a field whose size is <= 0 to be invalid... However, your file has some of them (with no value; size=0), which causes the issues you've been observing.

=> I've changed the parser to accept fields with size = 0. There's actually nothing wrong with them; they can be considered as "flags" somehow 😁

Zeugma440 commented 9 months ago

Fix is available on today's v5.08

m0nkge commented 9 months ago

Run a couple of quick tests and everything looks good.

Thanks for the quick update.

Zeugma440 commented 9 months ago

You're very welcome ;)