Based on the answer of ebidel, one can read id3v1 tags by using jDataView:
document.querySelector(\'input[type=\"file\"]\').onchange = function (e) {
var rea
Partially Correct Answer (it properly reads utf8 formatted id3v2.4.0 including cover)
The things i asked in my question probably work now.
I wanted a very crude minimal function set to handle only id3v2.4.0 & and also parse the attached image.
With the help of @Siderite Zackwehdex, which answer is marked as correct, i understood the important part of the code that was missing.
As i had some time to play with it i made various modifications to the code.
First of all sorry for the compressed script but i have a better overview of the overall code. it's easier for me. if you have some questions about the code just ask.
Anyway, i removed the uses_synch
... it's really hard to find a file that uses synch. Same for the has_extended_hdr
.I also remove the support for id3v2.0.0 to id3v2.2.0. I added a version check, that one works with all id3v2 subversions.
The main function output contains an array with all the tags, inside you can also find the id3v2 Version.Last, but i guess usefull to expand, i added a custom FRAME object that contains custom functions for FRAMES other than textFrames. The now only function inside converts the image/cover/APIC to a easy to use base64 string. Doing so the array can be stored as a JSON string.
While for some of you the compatibility is important the above mentioned exended header or sync are actually the smallest problem.
PROBLEMS
The encoding needs to be UTF-8 else you get strange text paddings and some images are parsed only partially. basically broken.
I want to avoid the use of external library or even a really big function just for that ... there needs to be some smart simple solution to handle properly the encoding. ISO-8859-1,UTF-8,UTF-16 .. big endian... whatever... #00 vs #00 00 ..
If that is done the support can be improved exponentially.
I hope that some of you have a solution for that.
CODE
DataView.prototype.str=function(a,b,c,d){//start,length,placeholder,placeholder
b=b||1;c=0;d='';for(;c'Z')||c+e>b)break;
g[h=a.str(c,4)]=frID3[h]?frID3[h](a,c,d,e):a.str(c+d,e);
c+=e+d;
}
console.log(g);
}
DEMO
https://jsfiddle.net/2awq6pz7/