Git Product home page Git Product logo

Comments (9)

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

It likely means that your ID3v2 tag is corrupt.

That error is generated on line 365 of module.tag.id3v2.php and happens when the current ID3v2 frame name/size is invalid and where the next frame should be is also not a valid ID3v2 frame.

from getid3.

rochapablo avatar rochapablo commented on August 23, 2024

Right! I've found out that some files work while others doesn't. Even though the file that doesn't work has the details, so is there any way to read that information ignoring this error?

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

No. Your ID3v2 tag is corrupt at some point. If it was just a single frame that was corrupted then getID3 would skip it and continue with the next frame, but this message indicates that the ID3v2 tag is corrupted to the point where the following ID3v2 frame is either also corrupted or not where it's supposed to be so there is no way to continue parsing the ID3v2 tag so getID3 aborts processing it.

This kind of corruption shouldn't happen. Either you have a problem with your disk, or possibly your files are being tagged with a very-broken tagger.
However if you think this is happening more than it should, or if the ID3v2 data appears readable in some other program but not getID3 (please be sure it's ID3v2 data that you're seeing and not ID3v1 or APE or Lyrics3 or other tags) please reopen this ticket and send a sample file to info @ getid3.org

from getid3.

rochapablo avatar rochapablo commented on August 23, 2024

Sorry, but just to be sure about what data I'm reading, here's my code:

$getID3 = new \getID3;
$fileinfo = $getID3->analyze('the/folder/to/my/file.mp3');
if (isset($fileinfo['error'])) {
   return array('error' => $fileinfo['error']);
}
return $fileinfo['tags']['id3v2'];

So, the error happen "with some files" at the first return, where I don't have the change of read id3v1, id3v2 or any other tag.

As you said, I'm able to read the detail of the file thought Windows that way I guess that the file is OK.

And how can I send the file to info @ getid3.org? Should I go to forum?

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

Windows Explorer (and most programs) will show you a combined version of whatever tags are available. If ID3v2 is absent (or in this case corrupted) but the file is also tagged with ID3v1 (and/or APE, etc) then the information shown for artist, title, etc will be pulled from whatever data is available. I suspect you have a file with a valid ID3v1 and an invalid ID3v2.

getID3 can also return a combined [comments] key that is probably more useful than data that may or may not be in one of many different tag formats. Just include getid3_lib::CopyTagsToComments($fileinfo); after the call to analyze and then look in [comments] rather than [tags][id3v2].

At the point you're returning the error the analysis is complete. You will have partially-processed ID3v2 because it aborted due to a corrupt tag, but ID3v1 should have been parsed, as well as any other tag formats and the MP3 data itself.

As for the sample file, open your favourite email client and send an email to [email protected]...

from getid3.

rochapablo avatar rochapablo commented on August 23, 2024

Sorry again...

I don't know what this means, but I'm also getting this warning:

error parsing "TT2" (10 bytes into the ID3v2.3 tag). (ERROR: !IsValidID3v2FrameName("TT2 ", 3))).

Here's what I tried:

$getID3 = new \getID3;
$getID3->option_tag_id3v2 = false;
$fileinfo = $getID3->analyze(...);
$comments = \getid3_lib::CopyTagsToComments($fileinfo);

But none of this return any tags or comments. I'll be sending the audio just in case.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

Yup, your file is broken. iTunes doesn't know what it's doing.
It's roughly the same issue as mentioned in the readme.txt line 466 -- various version of iTunes have been known to write completely broken ID3v2 tags in a strange mishmash of ID3v2.2 and ID3v2.3 standards, which are totally incompatible. It uses the basic structure of ID3v2.3 but uses IDv3v2.2 frame names (which are 3-characters-long) incorrectly padded to 4 bytes to fit in the ID3v2.3 structure, but the frame names all changed between ID3v2.2 and ID3v2.3 and null-padding them is totally wrong. I don't know who let that out of quality control, but I suppose Apple just thought as long as their own broken software could read their own broken tags it didn't matter if the tags matched the published standard, or if any other programs could read them.

In short: your file is broken, and should be re-tagged with a sane tagger.

That said, I'll see if it's possible to automatically detect such blatant standards abuse and trick getID3 into parsing it correctly. I'll let you know.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

I have managed to patch getID3 to detect and work around the mess that iTunes makes. You should now get a warning for each malformed frame name but the ID3v2 as a whole should parse.

from getid3.

rochapablo avatar rochapablo commented on August 23, 2024

Wow! that's was awesome!

Thank you for your time and help, I really appreciate that.

from getid3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.