Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Format of WM/Picture tag in WMA/ASF (Read 6309 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Format of WM/Picture tag in WMA/ASF

Hi, trying to add support for reading/writing Picture metadata field from WMA to the http://www.jthink.net/jaudiotagger/index.jsp LGPL library.

I can see they are Content Descriptors like other fields with normal name, type and size, but can't quite work out the start of Content Desciptor value , it contains three bytes which Im unable to decode. it seems I can ignore them for reading but I need to know the correct value for writing, any ideas.

Content Desciptor value format:
byte0      ??
byte1      ??
byte2      ??
null byte
null byte
mimetype encoded as UTF-16LE
null byte
null byte
description encoded as UTF-16LE (optional)
null byte
null byte
image data

cheers Paul

Format of WM/Picture tag in WMA/ASF

Reply #1
I wrote some code to read the tags from WMA files a couple of years back. I remember there not being much helpful information around then on the structure of the picture data and having to do a lot of experimenting.
Anyway, according to the comments in my code

WM/Picture is structured as follows
1st byte is the picture type (value between 0 and 20)
Next 4 bytes are in LE format. They give the size of the picture data
Next is a LPWSTR which gives the MIME type
Next is a LPWSTR which gives a picture description
Then is the actual picture data

In my notes along with my code, I have the following information for the picture type

Value  Description   
0      Picture of a type not specifically listed in this table
1      32 pixel by 32 pixel file icon. Use only with portable network graphics (PNG) format 
2      File icon not conforming to type 1 above     
3      Front album cover     
4      Back album cover     
5      Leaflet page 
6      Media. Typically this type of image is of the label side of a CD     
7      Picture of the lead artist, lead performer, or soloist
8      Picture of one of the artists or performers   
9      Picture of the conductor     
10      Picture of the band or orchestra     
11      Picture of the composer
12      Picture of the lyricist or writer     
13      Picture of the recording studio or location   
14      Picture taken during a recording session     
15      Picture taken during a performance   
16      Screen capture from a movie or video 
17      A bright colored fish 
18      Illustration 
19      Logo of the band or artist   
20      Logo of the publisher or studio

Its been a couple of years since I looked at this code, but I think it was working ok - heres a link to it if you want to try it out (and read the code/comments).

http://members.upc.ie/p.mc.quillan/standar...parser_v0.2.tar

Maybe it'll be of some help to you.