wilsonyu2006 / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

APIC frames "missing" from some files (hash collision) #167

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Debugging an issue with Mutagen apparently failing to load multiple APIC frames 
in a single file I think I've found a bug.

If the APIC frames have empty descriptions there will be a collision on their 
HashKey. From the APIC frame class:

    @property
    def HashKey(self):
        return '%s:%s' % (self.FrameID, self.desc)

As you can see, the key will be simply 'APIC:' - causing loaded_frame() method 
to only support a single APIC frame with an empty description, per:

    self[tag.HashKey] = tag

I'm not sure what to suggest as a fix - or even if empty descriptions are 
strictly valid.

If you require more info just let me know.

Thanks,
Chip Bell

Original issue reported on code.google.com by clayn...@gmail.com on 4 Feb 2014 at 6:29

GoogleCodeExporter commented 8 years ago
FWIW, as a workaround, I've included the APIC "type" field in the key - it 
seemed most appropriate for a quick fix.

Original comment by clayn...@gmail.com on 4 Feb 2014 at 6:36

GoogleCodeExporter commented 8 years ago
id3 spec: "There may be several pictures attached to one file, each in their 
individual “APIC” frame, but only one with the same content descriptor"

Original comment by reiter.christoph@gmail.com on 4 Feb 2014 at 4:13

GoogleCodeExporter commented 8 years ago
Okay. Thanks for the information - the files I'm working with then are simply 
non-conforming. I guess at best this could prompt a warning or some such, 
though obviously a low priority enhancement.

Original comment by clayn...@gmail.com on 5 Feb 2014 at 3:01

GoogleCodeExporter commented 8 years ago
mutagen has moved to Bitbucket: https://bitbucket.org/lazka/mutagen/issue/167

Original comment by reiter.christoph@gmail.com on 4 Jul 2014 at 3:34