[gnome-music/wip/mschraal/art-fixes-regressions: 1/5] embeddedart: Accept undefined image type




commit 8846e23de5d3b28a4361a91424e335e3e85f415e
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Sep 7 00:13:51 2021 +0200

    embeddedart: Accept undefined image type
    
    MP3's often have an image tag, with an image type indicator. This
    preferrably should be 'Cover (front)'. However, it is a common mistake
    to mark it as 'Other'. Accept the latter type as well.
    
    In GStreamer terms `Other` translates to TYPE_UNDEFINED.

 gnomemusic/embeddedart.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/embeddedart.py b/gnomemusic/embeddedart.py
index 2648c5ea5..dd4139536 100644
--- a/gnomemusic/embeddedart.py
+++ b/gnomemusic/embeddedart.py
@@ -134,7 +134,9 @@ class EmbeddedArt(GObject.GObject):
                 "image-type", GstTag.TagImageType)
             if not success:
                 continue
-            if image_type != GstTag.TagImageType.FRONT_COVER:
+            if image_type not in [
+                    GstTag.TagImageType.UNDEFINED,
+                    GstTag.TagImageType.FRONT_COVER]:
                 continue
 
             buf = sample.get_buffer()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]