[Kde-imaging] kdeextragear-libs-1/kipi-plugins/sendimages
Gilles Caulier
caulier.gilles at free.fr
Sat Sep 25 15:06:11 CEST 2004
CVS commit by cgilles:
KIPI sendimages plugin : now, resized JPEG images don't lost the EXIF informations !
CCMAIL: kde-imaging at kde.org, digikam-users at lists.sourceforge.net
A exifrestorer.cpp 1.1 [GPL]
A exifrestorer.h 1.1 [GPL]
A jpegsection.h 1.1 [GPL]
M +2 -1 Makefile.am 1.6
M +22 -0 sendimages.cpp 1.13
--- kdeextragear-libs-1/kipi-plugins/sendimages/Makefile.am #1.5:1.6
@@ -7,5 +7,6 @@
# Srcs for the plugin
kipiplugin_sendimages_la_SOURCES = plugin_sendimages.cpp sendimagesdialog.cpp \
- listimageserrordialog.cpp sendimages.cpp
+ listimageserrordialog.cpp sendimages.cpp \
+ exifrestorer.cpp
# Libs needed by the plugin
--- kdeextragear-libs-1/kipi-plugins/sendimages/sendimages.cpp #1.12:1.13
@@ -57,4 +57,5 @@
#include "sendimagesdialog.h"
#include "listimageserrordialog.h"
+#include "exifrestorer.h"
#include "actions.h"
@@ -176,4 +177,25 @@ void SendImages::run()
else // Resized images OK...
{
+ // Only try to write Exif if both src and destination are JPEG files.
+
+ if (QString(QImageIO::imageFormat(imageName)).upper() == "JPEG" &&
+ m_imageFormat.upper() == "JPEG")
+ {
+ ExifRestorer exifHolder;
+ exifHolder.readFile(imageName, ExifRestorer::ExifOnly);
+
+ QString targetFile = m_tmp + imageNameFormat;
+
+ if (exifHolder.hasExif())
+ {
+ ExifRestorer restorer;
+ restorer.readFile(targetFile, ExifRestorer::EntireImage);
+ restorer.insertExifData(exifHolder.exifData());
+ restorer.writeFile(targetFile);
+ }
+ else
+ kdWarning( 51000 ) << ("createThumb::No Exif Data Found") << endl;
+ }
+
d = new KIPISendimagesPlugin::EventData;
d->action = KIPISendimagesPlugin::ResizeImages;
More information about the Kde-imaging
mailing list