getID3
getID3 copied to clipboard
BOM included for short tags
I have a mp3 with the title of just 0
(id3v2 with 01 encoding). I verified the frame data is indeed \x01\xff\xfe\x30\x00\x00\x00
. However, when I get the title of this mp3 with getID3
, getID3
would just return the raw value (i.e. prefixed with BOM, trailing \x00
not removed). This is not the case when the title has two characters (e.g. 00
).
I'm using the latest commit from the 2.0 branch (8cf765ec4c42ed732993a9aa60b638ee398df154).
Repro
Save the following as get_tag.php
use JamesHeinrich\GetID3;
require __DIR__ . "/vendor/autoload.php";
$getID3 = new GetID3\GetID3;
if (count($argv) <= 1)
{
die("Missing filename.\n");
}
$tags= $getID3->analyze($argv[1]);
echo $tags['tags']['id3v2']['title'][0];
Download the sames from here and you should be able to repro what I'm seeing here:
$ php get_tags.php 00.mp3 | xxd
00000000: 3030 00
$ php get_tags.php 0.mp3 | xxd
00000000: fffe 3000 ..0.