[tracker/albumart-quill] Allowing different image libraries to deal with albumart image formats



commit 4a622efdb35553bb901007a1a1024a9c9fd2f1c0
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Nov 3 12:41:48 2009 +0100

    Allowing different image libraries to deal with albumart image formats
    
    Split the code that uses pixbuf out of tracker-albumart.c into four files:
      - tracker-albumart-quill.cpp : C++ code that uses libquill for this
      - tracker-albumart-pixbuf.c  : C code that uses GdkPixbuf forthis
      - tracker-albumart-dummy.c   : C code that does nothing but return FALSE,
                                     elected in case both are absent
      - tracker-albumart-generic.h : Generic API for above

 configure.ac                                       |   57 +++++++++-
 src/tracker-extract/Makefile.am                    |   12 ++-
 src/tracker-extract/tracker-albumart-dummy.c       |   40 +++++++
 src/tracker-extract/tracker-albumart-generic.h     |   40 +++++++
 src/tracker-extract/tracker-albumart-pixbuf.c      |  111 ++++++++++++++++++++
 src/tracker-extract/tracker-albumart-quill.cpp     |   97 +++++++++++++++++
 src/tracker-extract/tracker-albumart.c             |  103 +++----------------
 .../tracker-extract-gstreamer-helix.c              |   31 ++----
 src/tracker-extract/tracker-extract-gstreamer.c    |   25 +----
 src/tracker-extract/tracker-extract-mp3.c          |   10 --
 10 files changed, 379 insertions(+), 147 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fca54b9..0a897ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,6 +139,7 @@ LIBNOTIFY_REQUIRED=0.4.3
 HAL_REQUIRED=0.5
 DEVKIT_POWER_REQUIRED=007
 GDKPIXBUF_REQUIRED=2.12.0
+QUILL_REQUIRED=1.0.0
 UNAC_REQUIRED=1.0.0
 POPPLER_GLIB_REQUIRED=0.4.5
 CAIRO_REQUIRED=1.0
@@ -451,11 +452,56 @@ AM_CONDITIONAL(HAVE_LIBXML2, test "x$have_libxml2" = "xyes")
 ##################################################################
 
 AC_ARG_ENABLE(gdkpixbuf, 
-	      AS_HELP_STRING([--enable-gdkpixbuf],
-			     [enable GdkPixbuf support, (MP3 album art) [[default=auto]]]),,
-	      [enable_gdkpixbuf=auto])
+              AS_HELP_STRING([--enable-gdkpixbuf],
+                             [enable GdkPixbuf support, (MP3 album art) [[default=auto]]]),,
+              [enable_gdkpixbuf=auto])
 
-if test "x$enable_gdkpixbuf" != "xno"; then
+##################################################################
+# Check for QUILL needed for the MP3 album art extractor
+##################################################################
+
+AC_ARG_ENABLE(quill,
+              AS_HELP_STRING([--enable-quill],
+                             [enable QUILL support, (MP3 album art) [[default=auto]]]),,
+              [enable_quill=auto])
+
+selected_for_albumart="no  (disabled)"
+
+
+##################################################################
+# Check for QUILL needed for the MP3 album art extractor cont
+##################################################################
+
+
+if test "x$enable_quill" != "xno" && test "x$enable_gdkpixbuf" != "xyes"; then
+   PKG_CHECK_MODULES(QUILL,
+		     [quill >= $QUILL_REQUIRED],
+		     [have_quill=yes],
+		     [have_quill=no])
+   AC_SUBST(QUILL_LIBS)
+   AC_SUBST(QUILL_CFLAGS)
+
+   if test "x$have_quill" = "xyes"; then
+      AC_DEFINE(HAVE_QUILL, [], [Define if we have QUILL])
+      selected_for_albumart="yes (libquill)"
+   fi
+else
+   have_quill="no  (disabled)"
+fi
+
+if test "x$enable_quill" = "xyes"; then
+   if test "x$have_quill" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find QUILL >= $QUILL_REQUIRED.])
+   fi
+fi
+
+AM_CONDITIONAL(HAVE_QUILL, test "x$have_quill" = "xyes")
+
+##################################################################
+# Check for GdkPixbuf, needed for the MP3 album art extractor cont
+##################################################################
+
+if test "x$enable_gdkpixbuf" != "xno" && test "x$enable_quill" != "xyes"; then
    PKG_CHECK_MODULES(GDKPIXBUF,
 		     [gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED],
 		     [have_gdkpixbuf=yes],
@@ -465,6 +511,7 @@ if test "x$enable_gdkpixbuf" != "xno"; then
 
    if test "x$have_gdkpixbuf" = "xyes"; then
       AC_DEFINE(HAVE_GDKPIXBUF, [], [Define if we have GdkPixbuf])
+      selected_for_albumart="yes (GdkPixbuf)"
    fi
 else
    have_gdkpixbuf="no  (disabled)"
@@ -1501,7 +1548,7 @@ Metadata Extractors:
 	Support embedded / sidecar XMP:		$have_exempi
 	Support video formats:			$have_video_handler ($have_video_handler_app) (tagreadbin: $enable_tagreadbin)
 	Support helix formats (RPM/RM/etc):     $have_gstreamer_helix
-	Support MP3 album art (w/ GdkPixbuf):	$have_gdkpixbuf
+	Support MP3 album art:                  $selected_for_albumart
 	Support playlists (w/ Totem):           $have_playlist
 
 Plugins:
diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am
index b098bd8..f4f16f1 100644
--- a/src/tracker-extract/Makefile.am
+++ b/src/tracker-extract/Makefile.am
@@ -256,7 +256,8 @@ tracker_extract_SOURCES = 						\
 	tracker-fts-config.c						\
 	tracker-fts-config.h						\
 	tracker-main.c							\
-	tracker-main.h
+	tracker-main.h							\
+	tracker-albumart-generic.h
 
 tracker_extract_LDADD = 						\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la	\
@@ -273,6 +274,15 @@ endif
 
 if HAVE_GDKPIXBUF
 tracker_extract_LDADD += $(GDKPIXBUF_LIBS)
+tracker_extract_SOURCES += tracker-albumart-pixbuf.c
+else
+if HAVE_QUILL
+INCLUDES += $(QUILL_CFLAGS)
+tracker_extract_SOURCES += tracker-albumart-quill.c
+tracker_extract_LDADD += $(QUILL_LIBS)
+else
+tracker_extract_SOURCES += tracker-albumart-dummy.c
+endif
 endif
 
 marshal_sources =                                         		\
diff --git a/src/tracker-extract/tracker-albumart-dummy.c b/src/tracker-extract/tracker-albumart-dummy.c
new file mode 100644
index 0000000..440c47d
--- /dev/null
+++ b/src/tracker-extract/tracker-albumart-dummy.c
@@ -0,0 +1,40 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ * Philip Van Hoof <philip codeminded be>
+ */
+
+#include "tracker-albumart-generic.h"
+
+gboolean
+tracker_albumart_file_to_jpeg (const gchar *filename, 
+                               const gchar *target)
+{
+	return FALSE;
+}
+
+gboolean
+tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
+                                 size_t               len,
+                                 const gchar         *buffer_mime,
+                                 const gchar         *target)
+{
+	return FALSE;
+}
diff --git a/src/tracker-extract/tracker-albumart-generic.h b/src/tracker-extract/tracker-albumart-generic.h
new file mode 100644
index 0000000..1054067
--- /dev/null
+++ b/src/tracker-extract/tracker-albumart-generic.h
@@ -0,0 +1,40 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ * Philip Van Hoof <philip codeminded be>
+ */
+
+#ifndef __TRACKER_ALBUMART_GENERIC_H__
+#define __TRACKER_ALBUMART_GENERIC_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS 
+
+gboolean  tracker_albumart_file_to_jpeg   (const gchar         *filename, 
+                                           const gchar         *target);
+gboolean  tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
+                                           size_t               len,
+                                           const gchar         *buffer_mime,
+                                           const gchar         *target);
+
+G_END_DECLS
+
+#endif /* __TRACKER_ALBUMART_GENERIC_H__ */
diff --git a/src/tracker-extract/tracker-albumart-pixbuf.c b/src/tracker-extract/tracker-albumart-pixbuf.c
new file mode 100644
index 0000000..cbda326
--- /dev/null
+++ b/src/tracker-extract/tracker-albumart-pixbuf.c
@@ -0,0 +1,111 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ * Philip Van Hoof <philip codeminded be>
+ */
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+#include "tracker-albumart-generic.h"
+
+gboolean
+tracker_albumart_file_to_jpeg (const gchar *filename, 
+                               const gchar *target)
+{
+	GdkPixbuf *pixbuf;
+	GError *error = NULL;
+
+	pixbuf = gdk_pixbuf_new_from_file (filename, &error);
+
+	if (error) {
+		g_clear_error (&error);
+
+		return FALSE;
+	} else {
+		gdk_pixbuf_save (pixbuf, target, "jpeg", &error, NULL);
+		g_object_unref (pixbuf);
+
+		if (error) {
+			g_clear_error (&error);
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+
+gboolean
+tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
+                                 size_t               len,
+                                 const gchar         *buffer_mime,
+                                 const gchar         *target)
+{
+	if (g_strcmp0 (buffer_mime, "image/jpeg") == 0 ||
+	    g_strcmp0 (buffer_mime, "JPG") == 0) {
+
+		g_debug ("Saving album art using raw data as uri:'%s'", 
+		         target);
+
+		g_file_set_contents (target, buffer, (gssize) len, NULL);
+	} else {
+		GdkPixbuf *pixbuf;
+		GdkPixbufLoader *loader;
+		GError *error = NULL;
+
+		g_debug ("Saving album art using GdkPixbufLoader for uri:'%s'", 
+			 target);
+
+		loader = gdk_pixbuf_loader_new ();
+
+		if (!gdk_pixbuf_loader_write (loader, buffer, len, &error)) {
+			g_warning ("Could not write with GdkPixbufLoader when setting album art, %s", 
+			           error ? error->message : "no error given");
+
+			g_clear_error (&error);
+			gdk_pixbuf_loader_close (loader, NULL);
+
+			return FALSE;
+		}
+
+		pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+
+		if (!gdk_pixbuf_save (pixbuf, target, "jpeg", &error, NULL)) {
+			g_warning ("Could not save GdkPixbuf when setting album art, %s", 
+			           error ? error->message : "no error given");
+
+			g_clear_error (&error);
+			g_object_unref (pixbuf);
+			gdk_pixbuf_loader_close (loader, NULL);
+
+			return FALSE;
+		}
+
+		g_object_unref (pixbuf);
+
+		if (!gdk_pixbuf_loader_close (loader, &error)) {
+			g_warning ("Could not close GdkPixbufLoader when setting album art, %s", 
+			           error ? error->message : "no error given");
+			g_clear_error (&error);
+		}
+	}
+
+	return TRUE;
+}
diff --git a/src/tracker-extract/tracker-albumart-quill.cpp b/src/tracker-extract/tracker-albumart-quill.cpp
new file mode 100644
index 0000000..04f228a
--- /dev/null
+++ b/src/tracker-extract/tracker-albumart-quill.cpp
@@ -0,0 +1,97 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ * Philip Van Hoof <philip codeminded be>
+ */
+
+#include <quill.h>
+#include <quillfile.h>
+
+#include <QFile>
+#include <QBuffer>
+#include <QImageReader>
+#include <QuillImageFilterFactory>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#include "tracker-albumart-generic.h"
+
+
+G_BEGIN_DECLS
+
+static gboolean init = FALSE;
+
+gboolean
+tracker_albumart_file_to_jpeg (const gchar *filename, 
+                               const gchar *target)
+{
+	if (!init) {
+		QuillImageFilter::registerAll();
+		init = TRUE;
+	}
+
+	QFile file(filename);
+	if (file.open(QIODevice::ReadOnly)) {
+
+		QByteArray array = file.readAll();
+		QBuffer buffer(&array);
+		buffer.open(QIODevice::ReadOnly);
+
+		QImageReader reader(&buffer);
+
+		if (reader.canRead()) {
+			QImage image = reader.read();
+			QuillImageFilter *filter =
+			    QuillImageFilterFactory::createImageFilter("Save");
+			filter->setOption(QuillImageFilter::FileFormat, QVariant(QString("jpeg")));
+			filter->setOption(QuillImageFilter::FileName, QVariant(QString(target)));
+			filter->apply(image);
+			delete filter;
+		}
+	}
+	return TRUE;
+}
+
+gboolean
+tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
+                                 size_t               len,
+                                 const gchar         *buffer_mime,
+                                 const gchar         *target)
+{
+	if (!init) {
+		QuillImageFilter::registerAll();
+		init = TRUE;
+	}
+
+	QByteArray array = QByteArray ((const char *) buffer, (int) len);
+	QBuffer qbuffer(&array);
+	qbuffer.open(QIODevice::ReadOnly);
+	QImageReader reader(&qbuffer);
+	QImage image = reader.read();
+	QuillImageFilter *filter = QuillImageFilterFactory::createImageFilter("Save");
+	filter->setOption(QuillImageFilter::FileFormat, QVariant(QString("jpeg")));
+	filter->setOption(QuillImageFilter::FileName, QVariant(QString(target)));
+	filter->apply(image);
+	delete filter;
+	return TRUE;
+}
+
+G_END_DECLS
diff --git a/src/tracker-extract/tracker-albumart.c b/src/tracker-extract/tracker-albumart.c
index 09184f0..0cc61e7 100644
--- a/src/tracker-extract/tracker-albumart.c
+++ b/src/tracker-extract/tracker-albumart.c
@@ -32,10 +32,6 @@
 #include <glib/gstdio.h>
 #include <gio/gio.h>
 
-#ifdef HAVE_GDKPIXBUF
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#endif /* HAVE_GDKPIXBUF */
-
 #include <dbus/dbus-glib-bindings.h>
 
 #include <libtracker-common/tracker-storage.h>
@@ -44,15 +40,12 @@
 #include "tracker-dbus.h"
 #include "tracker-extract.h"
 #include "tracker-marshal.h"
+#include "tracker-albumart-generic.h"
 
 #define ALBUMARTER_SERVICE    "com.nokia.albumart"
 #define ALBUMARTER_PATH       "/com/nokia/albumart/Requester"
 #define ALBUMARTER_INTERFACE  "com.nokia.albumart.Requester"
 
-#define THUMBNAILER_SERVICE   "org.freedesktop.thumbnailer"
-#define THUMBNAILER_PATH      "/org/freedesktop/thumbnailer/Generic"
-#define THUMBNAILER_INTERFACE "org.freedesktop.thumbnailer.Generic"
-
 typedef struct {
 	TrackerStorage *hal;
 	gchar *art_path;
@@ -549,37 +542,22 @@ albumart_heuristic (const gchar *artist,
 					retval = error != NULL;
 					g_clear_error (&error);
 				}
-#ifdef HAVE_GDKPIXBUF
 			} else if (g_str_has_suffix (name, "png")) {
-				GdkPixbuf *pixbuf;
 				gchar *found;
 
+				if (!target) {
+					albumart_get_path (artist_stripped, 
+					                   album_stripped, 
+					                   "album", 
+					                   NULL, 
+					                   &target, 
+					                   NULL);
+				}
+
 				found = g_build_filename (dirname, name, NULL);
 				g_debug ("Album art (PNG) found in same directory being used:'%s'", found);
-
-				pixbuf = gdk_pixbuf_new_from_file (found, &error);
+				retval = tracker_albumart_file_to_jpeg (found, target);
 				g_free (found);
-
-				if (error) {
-					g_clear_error (&error);
-					retval = FALSE;
-				} else {
-					if (!target) {
-						albumart_get_path (artist_stripped, 
-								   album_stripped, 
-								   "album", 
-								   NULL, 
-								   &target, 
-								   NULL);
-					}
-					
-					gdk_pixbuf_save (pixbuf, target, "jpeg", &error, NULL);
-					g_object_unref (pixbuf);
-					
-					retval = error != NULL;
-					g_clear_error (&error);
-				}
-#endif /* HAVE_GDKPIXBUF */
 			}
 		}
 	}
@@ -624,8 +602,6 @@ albumart_signal_queue_thumbnail (const gchar *file,
 	g_signal_emit_by_name (object, "queue-thumbnail", file, mime);
 }
 
-#ifdef HAVE_GDKPIXBUF
-
 static gboolean
 albumart_set (const unsigned char *buffer,
 	      size_t               len,
@@ -635,6 +611,7 @@ albumart_set (const unsigned char *buffer,
 	      const gchar         *uri)
 {
 	gchar *local_path;
+	gboolean retval;
 
 	if (!artist && !album) {
 		g_warning ("Could not save embedded album art, no artist or album supplied");
@@ -643,55 +620,7 @@ albumart_set (const unsigned char *buffer,
 
 	albumart_get_path (artist, album, "album", NULL, &local_path, NULL);
 
-	if (g_strcmp0 (mime, "image/jpeg") == 0 ||
-	    g_strcmp0 (mime, "JPG") == 0) {
-		g_debug ("Saving album art using raw data as uri:'%s'", 
-			 local_path);
-
-		g_file_set_contents (local_path, buffer, (gssize) len, NULL);
-	} else {
-		GdkPixbuf *pixbuf;
-		GdkPixbufLoader *loader;
-		GError *error = NULL;
-
-		g_debug ("Saving album art using GdkPixbufLoader for uri:'%s'", 
-			 local_path);
-
-		loader = gdk_pixbuf_loader_new ();
-
-		if (!gdk_pixbuf_loader_write (loader, buffer, len, &error)) {
-			g_warning ("Could not write with GdkPixbufLoader when setting album art, %s", 
-				   error ? error->message : "no error given");
-
-			g_clear_error (&error);
-			gdk_pixbuf_loader_close (loader, NULL);
-			g_free (local_path);
-
-			return FALSE;
-		}
-
-		pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
-
-		if (!gdk_pixbuf_save (pixbuf, local_path, "jpeg", &error, NULL)) {
-			g_warning ("Could not save GdkPixbuf when setting album art, %s", 
-				   error ? error->message : "no error given");
-
-			g_clear_error (&error);
-			g_free (local_path);
-			g_object_unref (pixbuf);
-			gdk_pixbuf_loader_close (loader, NULL);
-
-			return FALSE;
-		}
-
-		g_object_unref (pixbuf);
-
-		if (!gdk_pixbuf_loader_close (loader, &error)) {
-			g_warning ("Could not close GdkPixbufLoader when setting album art, %s", 
-				   error ? error->message : "no error given");
-			g_clear_error (&error);
-		}
-	}
+	retval = tracker_albumart_buffer_to_jpeg (buffer, len, mime, local_path);
 
 	albumart_signal_queue_thumbnail (local_path, mime);
 	g_free (local_path);
@@ -699,8 +628,6 @@ albumart_set (const unsigned char *buffer,
 	return TRUE;
 }
 
-#endif /* HAVE_GDKPIXBUF */
-
 static void
 albumart_request_download (TrackerStorage *hal,
 			   const gchar    *album, 
@@ -984,7 +911,6 @@ tracker_albumart_process (const unsigned char *buffer,
 	}
 
 	if (!g_file_test (art_path, G_FILE_TEST_EXISTS)) {
-#ifdef HAVE_GDKPIXBUF
 		/* If we have embedded album art */
 		if (buffer && len > 0) {
 			processed = albumart_set (buffer,
@@ -994,7 +920,6 @@ tracker_albumart_process (const unsigned char *buffer,
 						  album,
 						  filename_uri);
 		} else {
-#endif /* HAVE_GDK_PIXBUF */
 			/* If not, we perform a heuristic on the dir */
 			gchar *key;
 			gchar *dirname;
@@ -1037,9 +962,7 @@ tracker_albumart_process (const unsigned char *buffer,
 			} else {
 				g_free (key);
 			}
-#ifdef HAVE_GDKPIXBUF
 		}
-#endif /* HAVE_GDKPIXBUF */
 
 		if (processed) {
 			albumart_signal_queue_thumbnail (filename_uri, "image/jpeg");
diff --git a/src/tracker-extract/tracker-extract-gstreamer-helix.c b/src/tracker-extract/tracker-extract-gstreamer-helix.c
index fdd44be..30b0f5c 100644
--- a/src/tracker-extract/tracker-extract-gstreamer-helix.c
+++ b/src/tracker-extract/tracker-extract-gstreamer-helix.c
@@ -825,28 +825,15 @@ tracker_extract_gstreamer_helix (const gchar *uri,
 
 	extract_metadata (extractor, uri, metadata, &artist, &album, &scount);
 
-	/* Save embedded art */
-	if (extractor->album_art_data && extractor->album_art_size) {
-
-#ifdef HAVE_GDKPIXBUF
-		tracker_process_albumart (extractor->album_art_data, extractor->album_art_size, NULL,
-				       /* artist */ NULL ,
-				       album,
-				       scount,
-				       uri);
-#else
-		tracker_process_albumart (NULL, 0, NULL,
-				       /* artist */ NULL ,
-				       album,
-				       scount,
-				       uri);
-
-#endif /* HAVE_GDKPIXBUF */
-		g_free (album);
-		g_free (artist);
-		g_free (scount);
-	}
-
+	tracker_process_albumart (extractor->album_art_data, extractor->album_art_size, NULL,
+			       /* artist */ NULL ,
+			       album,
+			       scount,
+			       uri);
+
+	g_free (album);
+	g_free (artist);
+	g_free (scount);
 
 	/* Also clean up */
 	gst_element_set_state (extractor->playbin, GST_STATE_NULL);
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 83bdcf7..9c9e4e7 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -894,25 +894,12 @@ tracker_extract_gstreamer (const gchar *uri,
 
 	extract_metadata (extractor, uri, metadata, &album, &scount);
 
-	/* Save embedded art */
-	if (extractor->album_art_data && extractor->album_art_size) {
-#ifdef HAVE_GDKPIXBUF
-		tracker_albumart_process (extractor->album_art_data, 
-					  extractor->album_art_size, 
-					  extractor->album_art_mime,
-					  /* g_hash_table_lookup (metadata, "Audio:Artist") */ NULL,
-					  album,
-					  uri);
-#else
-		tracker_albumart_process (NULL,
-					  0, 
-					  NULL,
-					  /* g_hash_table_lookup (metadata, "Audio:Artist") */ NULL,
-					  album,
-					  uri);
-		
-#endif /* HAVE_GDKPIXBUF */
-	}
+	tracker_albumart_process (extractor->album_art_data, 
+				  extractor->album_art_size, 
+				  extractor->album_art_mime,
+				  /* g_hash_table_lookup (metadata, "Audio:Artist") */ NULL,
+				  album,
+				  uri);
 
 	g_free (scount);
 	g_free (album);
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 1bfb1ec..e71fb9a 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -2082,22 +2082,12 @@ extract_mp3 (const gchar *uri,
 	/* Get mp3 stream info */
 	mp3_parse (buffer, buffer_size, audio_offset, uri, metadata, &filedata);
 
-#ifdef HAVE_GDKPIXBUF
 	tracker_albumart_process (filedata.albumartdata, 
 				  filedata.albumartsize, 
 				  filedata.albumartmime,
 				  NULL,
 				  filedata.title, 
 				  filename);
-#else
-	tracker_albumart_process (NULL, 
-				  0, 
-				  NULL,
-				  NULL,
-				  filedata.title, 
-				  filename);
-
-#endif /* HAVE_GDKPIXBUF */
 
 	g_free (filedata.title);
 	g_free (filedata.albumartdata);



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