Giter Club home page Giter Club logo

Comments (8)

nazar-pc avatar nazar-pc commented on May 26, 2024

Does it happen for any file? If so, can you provide some sample file?
This library is used in https://github.com/nazar-pc/CleverStyle-Music and I never seen this happening.

from metadata-audio-parser.

Fabiencdp avatar Fabiencdp commented on May 26, 2024

Same here, got the same file in "picture" property, for all files tested.
But i'm not sure if i use it correctly, Can you provide some exemple ?

Thanks

from metadata-audio-parser.

nazar-pc avatar nazar-pc commented on May 26, 2024

Here is an example in CoffeeScript in mentioned project: https://github.com/nazar-pc/CleverStyle-Music/blob/master/html/cs-music-player/script.coffee#L229
Better show your example so that I can suggest something.

from metadata-audio-parser.

Fabiencdp avatar Fabiencdp commented on May 26, 2024

Thanks for your reply,

Here is how i use it, i work on a ionic project, and browse audio file across an android device, for each audio file, i fetch some data, the parser work very well and fast, but "picture" return the same File object.

`getFile: function (fileEntry) {

        var deferred = $q.defer();

        fileEntry.file(function(file) {

            if ( file.type !== null && file.type.indexOf('audio') < 0 ) return deferred.resolve(false);

            // Create media object
            var media = new Media(fileEntry.fullPath);

            // Get meta and stuff
            parse_audio_metadata(file, function (tag) {

                console.log(tag);

                var result = {
                    coverUrl: tag.picture ? tag.picture.localURL : false,
                    description: '',
                    id: media.id,
                    provider: 'device',
                    score: '',
                    title: tag.title,
                    artist: tag.artist,
                    album: tag.album,
                    genre: tag.genre,
                    url: file.fullPath,
                    media: media,
                };

                deferred.resolve(result);

            }, function parseError(error) {
                console.log(error);
                deferred.resolve(false);
            })

        })

        return deferred.promise;

    },

`

See attach for the log of 'tag' response
image

from metadata-audio-parser.

nazar-pc avatar nazar-pc commented on May 26, 2024

Did you try to show that image on screen?
Because it is actually taken from that file, I think this might be a reason why you got such result. Also compare size of picture with size of source file whether they differ anyhow.
It should be fine, since other tags were extracted properly.

from metadata-audio-parser.

Fabiencdp avatar Fabiencdp commented on May 26, 2024

Thanks again, the size of File and Picture are the same, start and end looks good.
But how can you display an image with that kind of blob ?

from metadata-audio-parser.

nazar-pc avatar nazar-pc commented on May 26, 2024

url = URL.createObjectURL(metadata.picture) and you'll get something you can use as URL to add it on the page. Also if you work with multiple such objects do not forget to call URL.revokeObjectURL(url) afterwards to avoid memory leaks.

from metadata-audio-parser.

Fabiencdp avatar Fabiencdp commented on May 26, 2024

It fail too with message :

Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.

I think something dont work with the Cordova File Plugin, i'll try to find a solution.

from metadata-audio-parser.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.