Bug 129856

Summary: Export to remote web-service deletes Exif, when using the resize option.
Product: [Applications] digikam Reporter: Fabien Frejaville <fab>
Component: Plugin-WebService-PiwigoAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bearclaw, caulier.gilles, frederic.coiffier
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 8.0.0

Description Fabien Frejaville 2006-06-26 18:31:23 UTC
Version:           0.8.2-rc1 (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
OS:                Linux

Hi.
I'm running Digikam under Kubuntu Dapper (current stable release, up to date)
Kipi version: 0.1.2, with all (16) kipi modules loaded.

I'm exporting photos to a remote gallery (MENU : ALBUM > EXPORT > EXPORT TO REMOTE GALLERY)
I'm using Gallery2 (http://gallery.menalto.com/) remotely.


Everything runs fine if the option "resize photos before uploading" is left unchecked: the photo is exported, EXIF are still there remotely.
If you turn on this resizing feature, the photo is uploaded and perfectly resized, BUT all EXIF infos are lost (on the remote gallery).

Expected: the photos should be exported to the remote gallery without loosing EXIF, when I resize them before uploading.



Can you reproduce and/or try to fix it ?

Thanks a lot :)


Cordialement,

-- 
Fabien








KIPI (loading): KIPI::PluginLoader: plugin KameraKlient is in the ignore list for host application
KIPI (loading): KIPI::PluginLoader: Loaded plugin JPEGLossless
KIPI (loading): KIPI::PluginLoader: Loaded plugin CDArchiving
KIPI (loading): KIPI::PluginLoader: Loaded plugin ImagesGallery
KIPI (loading): KIPI::PluginLoader: Loaded plugin SendImages
KIPI (loading): KIPI::PluginLoader: Loaded plugin FlickrExport
KIPI (loading): KIPI::PluginLoader: Loaded plugin Calendar
KIPI (loading): KIPI::PluginLoader: Loaded plugin MPEGEncoder
KIPI (loading): KIPI::PluginLoader: Loaded plugin AcquireImages
KIPI (loading): KIPI::PluginLoader: Loaded plugin GalleryExport
KIPI (loading): KIPI::PluginLoader: Loaded plugin TimeAdjust
KIPI (loading): KIPI::PluginLoader: Loaded plugin FindImages
KIPI (loading): KIPI::PluginLoader: Loaded plugin PrintWizard
KIPI (loading): KIPI::PluginLoader: Loaded plugin WallPaper
KIPI (loading): KIPI::PluginLoader: Loaded plugin SlideShow
KIPI (loading): KIPI::PluginLoader: Loaded plugin BatchProcessImages
KIPI (loading): KIPI::PluginLoader: Loaded plugin RawConverter
Comment 1 Colin Guthrie 2006-06-27 01:35:21 UTC
I'll take a look at this shortly.

Cheers for the report.
Comment 2 Colin Guthrie 2006-08-31 16:02:16 UTC
*** Bug 133291 has been marked as a duplicate of this bug. ***
Comment 3 Colin Guthrie 2006-09-10 21:21:58 UTC
SVN commit 582849 by cguthrie:

Fixes the disappearing EXIF bug. Copied from Flickr.
BUG: 129856


 M  +2 -1      Makefile.am  
 AM            exifrestorer.cpp   [License: GPL]
 AM            exifrestorer.h   [License: GPL]
 M  +19 -0     gallerytalker.cpp  
 M  +0 -4      gallerywindow.cpp  
 AM            jpegsection.h   [License: GPL]


--- trunk/extragear/libs/kipi-plugins/galleryexport/Makefile.am #582848:582849
@@ -10,7 +10,8 @@
 		galleries.cpp gallerylist.cpp galleryconfig.cpp \
 		gallerywindow.cpp gallerytalker.cpp \
 		gallerywidget.cpp gallerympform.cpp galleryalbumdialog.ui \
-		galleryviewitem.cpp
+		galleryviewitem.cpp \
+		exifrestorer.cpp
 
 kipiplugin_galleryexport_la_LIBADD = -lkwalletclient $(LIB_KHTML) $(LIBKIPI_LIBS) $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
 
** trunk/extragear/libs/kipi-plugins/galleryexport/exifrestorer.cpp #property svn:eol-style
   + native
** trunk/extragear/libs/kipi-plugins/galleryexport/exifrestorer.cpp #property svn:executable
   + *
** trunk/extragear/libs/kipi-plugins/galleryexport/exifrestorer.cpp #property svn:mime-type
   + text/plain
** trunk/extragear/libs/kipi-plugins/galleryexport/exifrestorer.h #property svn:eol-style
   + native
** trunk/extragear/libs/kipi-plugins/galleryexport/exifrestorer.h #property svn:executable
   + *
** trunk/extragear/libs/kipi-plugins/galleryexport/exifrestorer.h #property svn:mime-type
   + text/plain
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerytalker.cpp #582848:582849
@@ -37,6 +37,7 @@
 #include "galleryitem.h"
 #include "gallerympform.h"
 #include "gallerytalker.h"
+#include "exifrestorer.h"
 
 namespace KIPIGalleryExportPlugin
 {
@@ -214,6 +215,24 @@
             image = image.smoothScale(maxDim, maxDim, QImage::ScaleMin);
             path = locateLocal("tmp", KURL(photoPath).filename());
             image.save(path, QImageIO::imageFormat(photoPath));
+
+            if ("JPEG" == QString(QImageIO::imageFormat(photoPath)).upper())
+            {
+              ExifRestorer exifHolder;
+              exifHolder.readFile(photoPath,ExifRestorer::ExifOnly);
+
+              if (exifHolder.hasExif())
+              {
+                ExifRestorer restorer;
+                restorer.readFile(path, ExifRestorer::EntireImage);
+                restorer.insertExifData(exifHolder.exifData());
+                restorer.writeFile(path);
+              }
+              else
+              {
+                kdWarning(51000) << "(galleryexport::Image doesn't have exif data)" << endl;
+              }
+            }
             kdDebug() << "Resizing and saving to temp file: "
                       << path << endl;
         }
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerywindow.cpp #582848:582849
@@ -182,10 +182,6 @@
 {
     GalleryList dlg(this, mpGalleries);
 
-/*
-    GalleryLogin dlg( this, i18n( "Login Into Remote Gallery" ),
-                      "", "", "", GalleryTalker::isGallery2() );
-*/
     if (QDialog::Accepted != dlg.exec())
     {
       close();
** trunk/extragear/libs/kipi-plugins/galleryexport/jpegsection.h #property svn:eol-style
   + native
** trunk/extragear/libs/kipi-plugins/galleryexport/jpegsection.h #property svn:executable
   + *
** trunk/extragear/libs/kipi-plugins/galleryexport/jpegsection.h #property svn:mime-type
   + text/plain
Comment 4 Colin Guthrie 2006-10-08 19:02:37 UTC
SVN commit 593666 by cguthrie:

Convert to Exiv2 Exif restorer.
CCBUG: 129856

 M  +5 -4      Makefile.am  
 D             exifrestorer.cpp  
 D             exifrestorer.h  
 M  +4 -13     gallerytalker.cpp  
 D             jpegsection.h  


--- trunk/extragear/libs/kipi-plugins/galleryexport/Makefile.am #593665:593666
@@ -5,16 +5,17 @@
 # Install this plugin in the KDE modules directory
 kde_module_LTLIBRARIES = kipiplugin_galleryexport.la
 
-kipiplugin_galleryexport_la_DEPENDENCIES = $(LIBKIPI_LIBS_DEP)
+kipiplugin_galleryexport_la_DEPENDENCIES = $(LIBKIPI_LIBS_DEP) \
+	$(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la 
 
 kipiplugin_galleryexport_la_SOURCES = plugin_galleryexport.cpp \
 		galleries.cpp gallerylist.cpp galleryconfig.cpp \
 		gallerywindow.cpp gallerytalker.cpp \
 		gallerywidget.cpp gallerympform.cpp galleryalbumdialog.ui \
-		galleryviewitem.cpp \
-		exifrestorer.cpp
+		galleryviewitem.cpp
 
-kipiplugin_galleryexport_la_LIBADD = -lkwalletclient $(LIB_KHTML) $(LIBKIPI_LIBS) $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
+kipiplugin_galleryexport_la_LIBADD = $(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la \
+	-lkwalletclient $(LIB_KHTML) $(LIBKIPI_LIBS) $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
 
 kipiplugin_galleryexport_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
 
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerytalker.cpp #593665:593666
@@ -37,7 +37,7 @@
 #include "galleryitem.h"
 #include "gallerympform.h"
 #include "gallerytalker.h"
-#include "exifrestorer.h"
+#include "exiv2iface.h"
 
 namespace KIPIGalleryExportPlugin
 {
@@ -218,20 +218,11 @@
 
             if ("JPEG" == QString(QImageIO::imageFormat(photoPath)).upper())
             {
-              ExifRestorer exifHolder;
-              exifHolder.readFile(photoPath,ExifRestorer::ExifOnly);
-
-              if (exifHolder.hasExif())
+              KIPIPlugins::Exiv2Iface exiv2;
+              if (exiv2.load(photoPath))
               {
-                ExifRestorer restorer;
-                restorer.readFile(path, ExifRestorer::EntireImage);
-                restorer.insertExifData(exifHolder.exifData());
-                restorer.writeFile(path);
+                exiv2.save(path);
               }
-              else
-              {
-                kdWarning(51000) << "(galleryexport::Image doesn't have exif data)" << endl;
-              }
             }
             kdDebug() << "Resizing and saving to temp file: "
                       << path << endl;