musicmetadata
musicmetadata copied to clipboard
[Question] Is there a way to not parse / load the picture buffer
Hi, I am currently parsing files in batches and found that sometimes there is an issue with the pictures / performance related. (I am using it in a Node.js context)
So, I was thinking to do two passes, one loads the metadata without the picture. Then, I would do a second pass later to get the picture.
In that case, is it possible to do something to optimise the first pass? like preventing from reading the picture in memory.
We can definitely add a flag to the options to disable the picture parser:
mm(stream, { disableArtworkParser: true }, function (err, metadata) {
Feel free to submit a pull request!
Hi. Nice. Well I can, but I am not familiar with audio files internal.
I've checked the code but I don't know how we should do that efficiently.
I've heard that mp3 must be read completely.
Does that mean that the picture will be loaded even though we won't do anything with it anyway?
I have found various places in the code regarding the picture, like:
-
var picture = common.readVorbisPicture(data)
-
cleanupPicture(value)
-
var picture = {description: description, data: new Buffer(picData.slice(off))}
In these parsers or commons:
Should I just skip these calls or is there something better we can do regarding how these audio files work?
Implemented in music-metadata: https://github.com/Borewit/music-metadata/issues/11