diff --git a/beets/mediafile.py b/beets/mediafile.py index dfc6a3dd5..b5c79798a 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -74,7 +74,7 @@ TYPES = { 'ape': 'APE', 'wv': 'WavPack', 'mpc': 'Musepack', - 'asf': 'Windows Media' + 'asf': 'Windows Media', } @@ -145,16 +145,10 @@ def _safe_cast(out_type, val): return val -def unpack_image(data): - """ - Helper function to unpack image data from a WM/Picture tag. +# Image coding for ASF/WMA. - The data has the following format: - 1 byte: Picture type (0-20), see ID3 APIC frame specification at http://www.id3.org/id3v2.4.0-frames - 4 bytes: Picture data length in LE format - MIME type, null terminated UTF-16-LE string - Description, null terminated UTF-16-LE string - The image data in the given length +def _unpack_asf_image(data): + """Unpack image data from a WM/Picture tag. """ (type, size) = struct.unpack_from("