From 5206c4c40d865babfbb0dc369d40991fb6c83453 Mon Sep 17 00:00:00 2001 From: Chad Wilson Date: Sun, 20 May 2012 01:01:23 +0800 Subject: [PATCH 1/2] ff d8 ff should be sufficient to detect image/jpeg - this allows it to handle JPEGs with EXIF data e.g. http://www.mediafire.com/?wf8orl8dh1d2c2e --- picard/util/mimetype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picard/util/mimetype.py b/picard/util/mimetype.py index ae53ebe9a..e3325067d 100644 --- a/picard/util/mimetype.py +++ b/picard/util/mimetype.py @@ -30,7 +30,7 @@ EXTENSION_MIME_TYPE_MAP = dict([(b, a) for a, b in MIME_TYPE_EXTENSION_MAP.items def get_from_data(data, filename=None, default=None): """Tries to determine the mime type from the given data.""" - if data.startswith('\xff\xd8\xff\xe0'): + if data.startswith('\xff\xd8\xff'): return 'image/jpeg' elif data.startswith('\x89PNG\x0d\x0a\x1a\x0a'): return 'image/png' From f352a24651d5cf6af471bb3284d9e835fa59f48e Mon Sep 17 00:00:00 2001 From: Chad Wilson Date: Sun, 20 May 2012 01:07:38 +0800 Subject: [PATCH 2/2] Update NEWS --- NEWS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.txt b/NEWS.txt index 366274094..4655f9f87 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -6,6 +6,7 @@ Version UNRELEASED - 2012-XX-XX * Fix $copy not preserving multi-value variables as documented (PICARD-138) * Load/save free-text tags for ID3 as TXXX frames (PICARD-148) * Fix writing of MusicBrainz Work Id / musicbrainz_workid to tags (PICARD-88) + * Handle mimetype for embedding cover art from EXIF jpegs (PICARD-27) Version 0.16 - 2011-10-23 * Added AcoustID support.