id3
id3 copied to clipboard
How to create a valid image url from ArrayBuffer
Thanks for you wonderful library, I've already tested this and this before, but yours is way faster.
I've got a question about how to use the returned image data. I'm currently doing it that way:
var arrayBufferView = new Uint8Array(tags.v2.image.data);
tags.v2.image.mime = tags.v2.image.mime || 'image/jpeg';
var blob = new Blob([arrayBufferView], {type: tags.v2.image.mime});
var urlCreator = window.URL || window.webkitURL;
var imageUrl = urlCreator.createObjectURL(blob);
This works sometimes, however most of the time it fails. Sometimes it just doesn't create a valid file URL, most of the time it creates only parts of the picture and rarely it works perfectly:
All of these mp3 covers are shown correctly in my windows explorer.
The ones that have a nice placeholder image don't have a tags.v2.image attribute. (which is alright, better have nothing then something wrong...)
The last one somehow created an invalid URL, the others show only a part of the image.
Interestingly the Beatles one doesn't show up in my explorer, but your library parses it correctly.
Am I doing this wrong?
That's very interesting. I haven't found a single file that works perfectly and also shows up in my explorer.
Same the other way around: All that work perfectly don't show up in my explorer at all.
This might indicate a windows (probably windows media player) only bug. My guess is that windows media player somehow screws with those tags to make it good for windows explorer, but your parser has problems with those files.
I'll be using this library for now, even though it's pretty slow. Thanks nevertheless.
Sorry about this, I am very short of time so didn't get chance to come on here yet. I'll check this and the other issues out tomorrow :)
Still seeing this issue - is there a chance this will get fixed?
I've the same issue..
I'm having the same issue.
Hi Zinggi, Was just implementing your library, and thought I was just messing up the ArrayBuffer conversion to base64 or blob. But then stumbled upon this post. Is there any chance of reviving this repository. I'm trying to make some sense of the problem, but haven't come up with anything yet. Thanks
To anyone else having this problem you can use the following gist to convert array buffer data to base64 image.