After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728338 - Media art should be saved in JPEG format
Media art should be saved in JPEG format
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: Arnel Borja
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-16 13:02 UTC by Arnel Borja
Modified: 2016-10-04 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
albumArtCache: Convert downloaded media covers to JPEG (4.96 KB, patch)
2014-04-16 16:22 UTC, Arnel Borja
needs-work Details | Review
albumArtCache: Convert downloaded media covers to JPEG (5.61 KB, patch)
2014-04-16 18:33 UTC, Arnel Borja
needs-work Details | Review
make sure thumbanils are jpg (3.25 KB, patch)
2016-02-08 15:01 UTC, Marinus Schraal
none Details | Review

Description Arnel Borja 2014-04-16 13:02:21 UTC
Currently, we just download the media art if it doesn't exists and a URL for the thumbnail is available from grilo, then saves it to the cache, hoping that it is a JPEG file.

We should use libmediaart here to save the media art, which converts it to JPEG. https://wiki.gnome.org/MediaArtStorageSpec states that all media art should be in JPEG.
Comment 1 Arnel Borja 2014-04-16 16:22:14 UTC
Created attachment 274472 [details] [review]
albumArtCache: Convert downloaded media covers to JPEG

Use libmediaart to save the media covers so that they will be converted to JPEG.
Comment 2 Vadim Rutkovsky 2014-04-16 16:28:56 UTC
Review of attachment 274472 [details] [review]:

::: gnomemusic/albumArtCache.py
@@ +209,3 @@
+            f = Gio.File.new_for_uri(uri)
+            success, contents, etag = f.load_contents(None)
+            streamInfo = f.query_info('standard::content-type', FileQueryInfoFlags.NONE, None)

Got "Error: global name 'FileQueryInfoFlags' is not defined" here when applied the patch
Comment 3 Vadim Rutkovsky 2014-04-16 16:30:58 UTC
Review of attachment 274472 [details] [review]:

Also I get tons of:
(gnome-music:14717): libmediaart-CRITICAL **: storage_get_device_roots: assertion 'IS_STORAGE (storage)' failed
which is probably libmediaart's fault, but it might be us setting some flags incorrectly
Comment 4 Arnel Borja 2014-04-16 18:33:20 UTC
Created attachment 274514 [details] [review]
albumArtCache: Convert downloaded media covers to JPEG

Ugh, forgot to initialize libmediaart and the Gio prefix on that enum.
Comment 5 Vadim Rutkovsky 2014-04-17 11:09:23 UTC
Review of attachment 274514 [details] [review]:

This needs rebasing after https://git.gnome.org/browse/gnome-music/commit/?id=41e7d8c (running callbacks in main thread). I'm not really good at this, so setting as 'needs-work'
Comment 6 Marinus Schraal 2016-02-08 15:01:07 UTC
Created attachment 320637 [details] [review]
make sure thumbanils are jpg

Fresh go at this, since the older patch seems a bit bitrotten.

Different approach: download the file to a tmp file, let libmediaart convert it to jpg and just save it to the mediaart suggested location.
Comment 7 Marinus Schraal 2016-09-27 23:05:55 UTC
I've added a wip/mschraal/coverart branch on git, which should fix this issue. Please test and report back.

Note that you need to remove your coverart (~/.cache/mediaart) and redownload to get the desired effect. This also mean reindexing of all your music files (as that is a possible coverart provider as well).
Comment 8 Marinus Schraal 2016-10-04 12:13:10 UTC
See #7

This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.