gthumb r2268 - in trunk: . libgthumb



Author: mjc
Date: Thu Feb  7 16:51:21 2008
New Revision: 2268
URL: http://svn.gnome.org/viewvc/gthumb?rev=2268&view=rev

Log:
2008-02-07  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/gth-exiv2-utils.cpp:
        Update DateTime upon file save.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/gth-exiv2-utils.cpp

Modified: trunk/libgthumb/gth-exiv2-utils.cpp
==============================================================================
--- trunk/libgthumb/gth-exiv2-utils.cpp	(original)
+++ trunk/libgthumb/gth-exiv2-utils.cpp	Thu Feb  7 16:51:21 2008
@@ -628,7 +628,8 @@
 		mandatory_string (ed, "Exif.Photo.ExifVersion", "48 50 50 49");
 		mandatory_string (ed, "Exif.Photo.ComponentsConfiguration", "1 2 3 0");
 		mandatory_string (ed, "Exif.Photo.FlashpixVersion", "48 49 48 48");
-		
+		mandatory_string (ed, "Exif.Image.Software", "gThumb " VERSION);
+
 		int width = 0;
 		int height = 0;
 		gdk_pixbuf_get_file_info (to_file, &width, &height);
@@ -638,8 +639,21 @@
 
 		if (height > 0)
 			ed["Exif.Photo.PixelYDimension"] = height;
-			
-		// TODO: update DateTime
+
+		time_t curtime = 0;
+		struct tm  tm;
+
+		time (&curtime);
+		localtime_r (&curtime, &tm);
+                char *buf = g_strdup_printf ("%04d:%02d:%02d %02d:%02d:%02d ",
+                                             tm.tm_year + 1900,
+                                             tm.tm_mon + 1,
+                                             tm.tm_mday,
+                                             tm.tm_hour,
+                                             tm.tm_min,
+                                             tm.tm_sec );
+		ed["Exif.Image.DateTime"] = buf;
+		g_free (buf);
 	
 		// Open second image (in many applications, this will actually
 		// be the same as the the first image (i.e., updating a file



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