Merge lp:~jpakkane/thumbnailer/embedded-album-art into lp:thumbnailer

Proposed by Jussi Pakkanen
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 93
Merged at revision: 93
Proposed branch: lp:~jpakkane/thumbnailer/embedded-album-art
Merge into: lp:thumbnailer
Diff against target: 60 lines (+9/-11)
2 files modified
src/CMakeLists.txt (+3/-2)
src/thumbnailer.cpp (+6/-9)
To merge this branch: bzr merge lp:~jpakkane/thumbnailer/embedded-album-art
Reviewer Review Type Date Requested Status
Victor Thompson (community) Approve
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Pete Woods (community) Needs Information
Review via email: mp+231207@code.launchpad.net

Commit message

Re-enable embedded album art.

Description of the change

Re-enable embedded album art.

CHECK MANUALLY THAT IT DOES NOT CAUSE GSTREAMER CLASHES!

Check both device and desktop.

The last time was nerve wrecking enough. :)

To post a comment you must log in.
Revision history for this message
Pete Woods (pete-woods) wrote :

Well this doesn't make the phone or desktop stuff crash as best as I can tell.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Pete Woods (pete-woods) wrote :

I tried this out with the following QML:

import QtQuick 2.0
import Ubuntu.Thumbnailer 0.1

Image {
    anchors.fill: parent
    source: "image://thumbnailer/home/USERNAME/Music/path/to/your.mp3"
}

and I just get back white images with a grey border. That's not quite what I'd expected.

review: Needs Information
Revision history for this message
Pete Woods (pete-woods) wrote :

I should add that I wasn't pointing it to the Beatles' "White Album" ;)

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

What happens if you compile it yourself and then do "tools/cachetool /home/USERNAME/Music/path/to/your.mp3"?

Revision history for this message
Pete Woods (pete-woods) wrote :

That seems to spit out the correct image file.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Does that qml file work if you point it to an image file?

Revision history for this message
Pete Woods (pete-woods) wrote :

Yes, of course it does.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

This don't make no sense. The code in cachetool does this:

std::string ofilename = t.get_thumbnail(ifilename, TN_SIZE_LARGE);

and the code in the plugin does this:

tgt_path = tn.get_thumbnail(src_path, desiredSize);

That is to say the exact same thing. Can you post the specific steps you take to run that qml bit including how you tell it to use your self built plugin instead of the global one? Thanks.

Revision history for this message
Pete Woods (pete-woods) wrote :

I installed the package using a .deb just to be paranoid.

You then can run the qml by doing:

qmlscene name_of_qml_file.qml

If you really want to run it from the local dir instead of from the system installed version do the following:

LD_LIBRARY_PATH=YOUR_BUILD_DIR/src QML2_IMPORT_PATH=YOUR_BUILD_DIR/plugins qmlscene name_of_qml_file.qml

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

This works for me if you add the missing slash:

source: "image://thumbnailer/home/USERNAME/Music/path/to/your.mp3"
                            A
Here: ----------------------|

There need to be two slashes, ootherwise the path is relative and not absolute. The uri specification swallows the first slash.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good, no regressions. +1

review: Approve
Revision history for this message
Victor Thompson (vthompson) wrote :

I know this is already Approved and in a silo, but myself and the rest of the Music app developers would like to how we would use this and fallback to using "image://albumart" if there is no embedded art. Or would that not be possible?

review: Needs Information
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

We have a mediascanner branch outstanding which will make query results contain a boolean telling whether the file contains an embedded image. Then you would do something like this:

if mediafile.has_thumbnail
  // get thumbnail with image://thumbnailer//path/to/file
else
  // get thumbnail with image://albumart/just_like_currently
endif

Revision history for this message
Victor Thompson (vthompson) wrote :

Excellent, thank you Jussi!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2014-07-31 14:49:36 +0000
3+++ src/CMakeLists.txt 2014-08-18 14:48:47 +0000
4@@ -1,5 +1,5 @@
5 add_library(thumbnailer SHARED
6-#audioimageextractor.cpp
7+audioimageextractor.cpp
8 imagescaler.cpp
9 lastfmdownloader.cpp
10 mediaartcache.cpp
11@@ -12,7 +12,8 @@
12
13 set(symbol_map "${CMAKE_CURRENT_SOURCE_DIR}/libthumbnailer.map")
14
15-target_link_libraries(thumbnailer #${GST_DEPS_LDFLAGS}
16+target_link_libraries(thumbnailer
17+ ${GST_DEPS_LDFLAGS}
18 ${GLIB_DEPS_LDFLAGS}
19 ${GIO_DEPS_LDFLAGS}
20 ${IMG_DEPS_LDFLAGS}
21
22=== modified file 'src/thumbnailer.cpp'
23--- src/thumbnailer.cpp 2014-08-11 14:20:24 +0000
24+++ src/thumbnailer.cpp 2014-08-18 14:48:47 +0000
25@@ -47,7 +47,7 @@
26
27 public:
28 ThumbnailCache cache;
29-// AudioImageExtractor audio;
30+ AudioImageExtractor audio;
31 VideoScreenshotter video;
32 ImageScaler scaler;
33 MediaArtCache macache;
34@@ -85,13 +85,11 @@
35 return fname;
36 }
37
38-string ThumbnailerPrivate::create_audio_thumbnail(const string &/*abspath*/,
39- ThumbnailSize /*desired_size*/, ThumbnailPolicy /*policy*/) {
40- // There was a symbol clash between 1.0 and 0.10 versions of
41- // GStreamer on the desktop so we need to disable in-process
42- // usage of gstreamer. Re-enable this once desktop moves to
43- // newer Qt multimedia that has GStreamer 1.0.
44-/*
45+string ThumbnailerPrivate::create_audio_thumbnail(const string &abspath,
46+ ThumbnailSize desired_size, ThumbnailPolicy /*policy*/) {
47+ string tnfile = cache.get_cache_file_name(abspath, desired_size);
48+ string tmpname = create_random_filename();
49+ bool extracted = false;
50 try {
51 if(audio.extract(abspath, tmpname)) {
52 extracted = true;
53@@ -103,7 +101,6 @@
54 unlink(tmpname.c_str());
55 return tnfile;
56 }
57- */
58 return "";
59 }
60 string ThumbnailerPrivate::create_generic_thumbnail(const string &abspath, ThumbnailSize desired_size) {

Subscribers

People subscribed via source and target branches

to all changes: