From 6857267cc77a0e3d69a2e7917b050251cdf0f88c Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 12 Sep 2013 10:16:47 -0700 Subject: [PATCH] opus: remove image from test file The encoder that produced this file for some reason included an empty image as the cover art and was confusing the tests. I left the null check in place to deal with this situation in the future. I think returning None is better than returning the empty string (which is of course not a valid image). --- beets/mediafile.py | 8 ++++---- test/rsrc/full.opus | Bin 7902 -> 7248 bytes test/test_mediafile_basic.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/beets/mediafile.py b/beets/mediafile.py index 1ac589536..ec14f99e9 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -756,9 +756,9 @@ class ImageField(object): return None else: - # Here we're assuming everything but MP3, MPEG-4, and FLAC - # use the Xiph/Vorbis Comments standard. This may not be - # valid. http://wiki.xiph.org/VorbisComment#Cover_art + # Here we're assuming everything but MP3, MPEG-4, FLAC, and + # ASF/WMA use the Xiph/Vorbis Comments standard. This may + # not be valid. http://wiki.xiph.org/VorbisComment#Cover_art if 'metadata_block_picture' not in obj.mgfile: # Try legacy COVERART tags. @@ -775,7 +775,7 @@ class ImageField(object): else: return None - if pic.data == '': + if not pic.data: return None return pic.data diff --git a/test/rsrc/full.opus b/test/rsrc/full.opus index 81cd652841bf2d54c37496bc3c33f3a2f5d31d70..9a5534b2215ddf17f1ff9c67b97d5c1ffde630f6 100644 GIT binary patch delta 29 lcmca-d%Gf10B}?K=5y(uMDHq#;ic5dS?a(24B|@M;FHs$9N|ne`oLb08i(T m&>&Y^N8*7k&=j&jJz2V_r)kuF>V+jaCJAC_+Ps@-sw4n0gd)=b diff --git a/test/test_mediafile_basic.py b/test/test_mediafile_basic.py index af54ee717..3cbee09e7 100644 --- a/test/test_mediafile_basic.py +++ b/test/test_mediafile_basic.py @@ -175,7 +175,7 @@ READ_ONLY_CORRECT_DICTS = { 'full.opus': { 'length': 1.0, - 'bitrate': 63216, + 'bitrate': 57984, 'format': 'Opus', 'samplerate': 48000, 'bitdepth': 0,