aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
748 stars 128 forks source link

Workaround for 3-character tags padded by NUL-byte #68

Closed aspyrx closed 7 years ago

aspyrx commented 7 years ago

Hello,

Thanks for providing a great library. I noticed an issue trying to load the attached picture for files that happen to use a NUL byte (\u0000) to pad 3-character tags.

The file for which I encountered the issue can be found here: download link

It uses the PIC tag to attach its album art, but when I use jsmediatags to parse all tags, I get:

  'PIC\u0000':
   { id: 'PIC\u0000',
     size: 504551,
     description: 'Unknown',
     data: null },

Clearly, the PIC frame reader isn't running since the tag doesn't match when the NUL byte is included. Hopefully this PR resolves the issue by just trimming off the padding byte if it is encountered.

I noticed the contribution guidelines request that the dist files not be committed, although the master branch seems to include them regardless. I haven't touched them just in case.

aadsm commented 7 years ago

@aspyrx is this still an issue? I've fixed a bunch of problems in the meanwhile and when I open the file you point to I can read the pic without a problem. Can you recheck please?

aspyrx commented 7 years ago

Looks like it's resolved - the NUL bytes were issues on my end, it turns out. Thanks for the fixes!