Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Is there a way to not parse / load the picture buffer #142

Open
AoDev opened this issue Jan 9, 2017 · 3 comments
Open

[Question] Is there a way to not parse / load the picture buffer #142

AoDev opened this issue Jan 9, 2017 · 3 comments

Comments

@AoDev
Copy link

AoDev commented Jan 9, 2017

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.

@leetreveil
Copy link
Owner

leetreveil commented Jan 10, 2017

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!

@AoDev
Copy link
Author

AoDev commented Jan 10, 2017

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?

@Borewit
Copy link

Borewit commented Aug 13, 2017

Implemented in music-metadata: Borewit/music-metadata#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants