[libmediaart] extract: Fixed Qt(4) backend to compile and removed all Tracker references
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libmediaart] extract: Fixed Qt(4) backend to compile and removed all Tracker references
- Date: Thu, 6 Feb 2014 17:47:31 +0000 (UTC)
commit 73bccfb1715c28fe15763c0c5adad88d30faba56
Author: Martyn Russell <martyn lanedo com>
Date: Thu Feb 6 17:41:56 2014 +0000
extract: Fixed Qt(4) backend to compile and removed all Tracker references
libmediaart/extractqt.cpp | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/libmediaart/extractqt.cpp b/libmediaart/extractqt.cpp
index d41cc10..2032600 100644
--- a/libmediaart/extractqt.cpp
+++ b/libmediaart/extractqt.cpp
@@ -48,12 +48,18 @@ static QGuiApplication *app = NULL;
static QApplication *app = NULL;
#endif /* HAVE_QT5 */
+static gint max_width_in_bytes = 0;
+
void
-media_art_plugin_init (void)
+media_art_plugin_init (gint max_width)
{
int argc = 1;
char *argv[2] = { (char*) "libmediaart", NULL };
+ g_return_if_fail (max_width >= 0);
+
+ max_width_in_bytes = max_width;
+
#ifdef HAVE_QT5
#ifdef HAVE_NEMO
@@ -79,10 +85,7 @@ gboolean
media_art_file_to_jpeg (const gchar *filename,
const gchar *target)
{
- TrackerConfig *config = tracker_main_get_config ();
- gint max_media_art_width = tracker_config_get_max_media_art_width (config);
-
- if (max_media_art_width < 0) {
+ if (max_width_in_bytes < 0) {
g_debug ("Not saving album art from file, disabled in config");
return TRUE;
}
@@ -126,21 +129,18 @@ media_art_file_to_jpeg (const gchar *filename,
}
gboolean
-tracker_media_art_buffer_to_jpeg (const unsigned char *buffer,
- size_t len,
- const gchar *buffer_mime,
- const gchar *target)
+media_art_buffer_to_jpeg (const unsigned char *buffer,
+ size_t len,
+ const gchar *buffer_mime,
+ const gchar *target)
{
- TrackerConfig *config = tracker_main_get_config ();
- gint max_media_art_width = tracker_config_get_max_media_art_width (config);
-
- if (max_media_art_width < 0) {
+ if (max_width_in_bytes < 0) {
g_debug ("Not saving album art from buffer, disabled in config");
return TRUE;
}
/* FF D8 FF are the three first bytes of JPeg images */
- if (max_media_art_width == 0 &&
+ if (max_width_in_bytes == 0 &&
(g_strcmp0 (buffer_mime, "image/jpeg") == 0 ||
g_strcmp0 (buffer_mime, "JPG") == 0) &&
(buffer && len > 2 && buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]