[Kde-imaging] extragear/libs/kipi-plugins/slideshow
Valerio Fuoglio
valerio.fuoglio at kdemail.net
Tue Feb 20 11:26:26 CET 2007
SVN commit 635564 by vfuoglio:
Added libkdcraw support.
Thanks to Gilles for the patch.
CCMAIL: kde-imaging at kde.org
CCMAIL: caulier.gilles at gmail.com
M +6 -3 Makefile.am
M +30 -1 imlibiface.cpp
--- trunk/extragear/libs/kipi-plugins/slideshow/Makefile.am #635563:635564
@@ -1,16 +1,19 @@
-INCLUDES = $(KIPI_PLUGINS_COMMON_INCLUDE) $(IMLIB2_CFLAGS) $(LIBKIPI_CFLAGS) $(all_includes)
METASOURCES = AUTO
+INCLUDES = $(KIPI_PLUGINS_COMMON_INCLUDE) $(IMLIB2_CFLAGS) $(LIBKIPI_CFLAGS) \
+ $(LIBKDCRAW_CFLAGS) $(all_includes)
+
# Install this plugin in the KDE modules directory
kde_module_LTLIBRARIES = kipiplugin_slideshow.la
-kipiplugin_slideshow_la_DEPENDENCIES = $(LIBKIPI_LIBS_DEP)
+kipiplugin_slideshow_la_DEPENDENCIES = $(LIBKIPI_LIBS_DEP) $(LIBKDCRAW_LIBS_DEP)
kipiplugin_slideshow_la_SOURCES = plugin_slideshow.cpp slideshow.cpp \
slideshowconfig.cpp imlibiface.cpp slideshowgl.cpp toolbar.cpp slideshowconfigbase.ui
#kipiplugin_slideshow_la_LIBADD = -lkdefx $(LIB_IMLIB2) $(GL_LIBS) $(LIBKIPI_LIBS) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
-kipiplugin_slideshow_la_LIBADD = -lkdefx -lImlib2 $(GL_LIBS) $(LIBKIPI_LIBS) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
+kipiplugin_slideshow_la_LIBADD = -lkdefx -lImlib2 $(GL_LIBS) $(LIBKIPI_LIBS) $(LIBKDCRAW_LIBS) \
+ $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
kipiplugin_slideshow_la_LDFLAGS = $(KIPI_PLUGINS_COMMON_LDFLAGS) -module $(KDE_PLUGIN) $(all_libraries) -lkipiplugins
--- trunk/extragear/libs/kipi-plugins/slideshow/imlibiface.cpp #635563:635564
@@ -19,15 +19,27 @@
*
* ============================================================ */
+// Qt includes.
+
#include <qwidget.h>
#include <qstring.h>
#include <qfile.h>
#include <qfileinfo.h>
+#include <qimage.h>
#include <qpixmap.h>
+// LibKDcraw includes.
+
+#include <libkdcraw/rawfiles.h>
+#include <libkdcraw/kdcraw.h>
+
+// Imlib2 includes.
+
#include <X11/Xlib.h>
#include <Imlib2.h>
+// Local includes.
+
#include "imlibiface.h"
namespace KIPISlideShowPlugin
@@ -81,7 +93,24 @@
imlib_context_push(imIface_->d->context);
- d->image = imlib_load_image(QFile::encodeName(file).data());
+ QString rawFilesExt(raw_file_extentions);
+
+ // Check if RAW file.
+ QFileInfo fileInfo(file);
+ if (rawFilesExt.upper().contains( fileInfo.extension(false).upper() ))
+ {
+ QImage rawPreview;
+ KDcrawIface::KDcraw::loadDcrawPreview(rawPreview, file);
+ d->image = imlib_create_image(rawPreview.width(), rawPreview.height());
+ imlib_context_set_image(d->image);
+ DATA32* data = imlib_image_get_data_for_reading_only();
+ memcpy(data, rawPreview.bits(), rawPreview.numBytes());
+ }
+ else
+ {
+ d->image = imlib_load_image(QFile::encodeName(file).data());
+ }
+
if (d->image) {
imlib_context_set_image(d->image);
d->valid = true;
More information about the Kde-imaging
mailing list