1
0
Fork 0
forked from len0rd/rockbox

Support technically invalid image/jpg mimetype in tags.

Although the mimetype for jpeg is clearly image/jpeg, many tagging
applications seem to use image/jpg, so we'll support that too.

Change-Id: Icb9063fd5a9d8aea169eaa7f74ac52b72603d148
Reviewed-on: http://gerrit.rockbox.org/318
Reviewed-by: Michael Giacomelli <mgiacomelli@gmail.com>
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
This commit is contained in:
Frank Gevaerts 2012-09-25 16:49:36 +02:00
parent 270d9eaee8
commit 341e2c46ca
2 changed files with 11 additions and 0 deletions

View file

@ -493,6 +493,10 @@ static int asf_parse_header(int fd, struct mp3entry* id3,
lseek(fd, strlength-32, SEEK_CUR); lseek(fd, strlength-32, SEEK_CUR);
if (!strcmp("image/jpeg", utf8buf)) { if (!strcmp("image/jpeg", utf8buf)) {
id3->albumart.type = AA_TYPE_JPG; id3->albumart.type = AA_TYPE_JPG;
} else if (!strcmp("image/jpg", utf8buf)) {
/* image/jpg is technically invalid,
* but it does occur in the wild */
id3->albumart.type = AA_TYPE_JPG;
} else if (!strcmp("image/png", utf8buf)) { } else if (!strcmp("image/png", utf8buf)) {
id3->albumart.type = AA_TYPE_PNG; id3->albumart.type = AA_TYPE_PNG;
} else { } else {

View file

@ -320,6 +320,13 @@ static int parsealbumart( struct mp3entry* entry, char* tag, int bufferpos )
entry->albumart.type = AA_TYPE_JPG; entry->albumart.type = AA_TYPE_JPG;
tag += 5; tag += 5;
} }
else if (strcmp(tag, "jpg") == 0)
{
/* image/jpg is technically invalid, but it does occur in
* the wild */
entry->albumart.type = AA_TYPE_JPG;
tag += 4;
}
else if (strcmp(tag, "png") == 0) else if (strcmp(tag, "png") == 0)
{ {
entry->albumart.type = AA_TYPE_PNG; entry->albumart.type = AA_TYPE_PNG;