[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/extragear/kde3/libs/kipi-plugins/jpeglossless
From:       Gilles Caulier <caulier.gilles () gmail ! com>
Date:       2009-01-09 14:31:49
Message-ID: 1231511509.354770.31698.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 908261 by cgilles:

backport commit #908250 from trunk


 M  +22 -7     convert2grayscale.cpp  
 M  +4 -4      convert2grayscale.h  


--- branches/extragear/kde3/libs/kipi-plugins/jpeglossless/convert2grayscale.cpp #908260:908261
@@ -6,8 +6,8 @@
  * Date        : 2003-10-14
  * Description : batch images grayscale conversion
  *
- * Copyright (C) 2004-2007 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
- * Copyright (C) 2003-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * Copyright (C) 2004-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2003-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
  *
  * NOTE: Do not use kdDebug() in this implementation because 
  *       it will be multithreaded. Use qDebug() instead. 
@@ -17,12 +17,12 @@
  * and/or modify it under the terms of the GNU General
  * Public License as published by the Free Software Foundation;
  * either version 2, 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.
- * 
+ *
  * ============================================================ */
 
 #define XMD_H
@@ -33,7 +33,7 @@
 
 // C Ansi includes.
 
-extern "C" 
+extern "C"
 {
 #include <sys/types.h>
 #include <unistd.h>
@@ -55,9 +55,14 @@
 #include <kurl.h>
 #include <ktempfile.h>
 
+// LibKExiv2 includes.
+
+#include <libkexiv2/kexiv2.h>
+
 // Local includes.
 
 #include "utils.h"
+#include "pluginsversion.h"
 #include "transupp.h"
 #include "convert2grayscale.h"
 #include "convert2grayscale.moc"
@@ -171,7 +176,7 @@
         err = i18n("Error in opening output file");
         return false;
     }
-    
+
     // Open jpeglib stream
     jpeg_stdio_src(&srcinfo, input_file);
 
@@ -195,7 +200,7 @@
 
     // Specify data destination for compression
     jpeg_stdio_dest(&dstinfo, output_file);
-    
+
     // Do not write a JFIF header if previously the image did not contain it
     dstinfo.write_JFIF_header = false;
 
@@ -217,6 +222,16 @@
     fclose(input_file);
     fclose(output_file);
 
+    // And set finaly update the metadata to target file.
+
+    KExiv2Iface::KExiv2 exiv2Iface;
+    exiv2Iface.load(dest);
+    QImage img(dest);
+    QImage exifThumbnail = img.scale(160, 120, QImage::ScaleMin);
+    exiv2Iface.setImageProgramId(QString("Kipi-plugins"), QString(kipiplugins_version));
+    exiv2Iface.setExifThumbnail(exifThumbnail);
+    exiv2Iface.save(dest);
+
     return true;
 }
 
--- branches/extragear/kde3/libs/kipi-plugins/jpeglossless/convert2grayscale.h #908260:908261
@@ -6,19 +6,19 @@
  * Date        : 2003-10-14
  * Description : batch images grayscale conversion
  *
- * Copyright (C) 2004-2007 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
- * Copyright (C) 2003-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * Copyright (C) 2004-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2003-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
  *
  * 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, 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.
- * 
+ *
  * ============================================================ */
 
 #ifndef convert2grayscale_H
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic