gthumb r2182 - in trunk: . libgthumb



Author: mjc
Date: Fri Jan 11 18:25:30 2008
New Revision: 2182
URL: http://svn.gnome.org/viewvc/gthumb?rev=2182&view=rev

Log:
2008-01-11  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/gth-exiv2-utils.cpp:
        Improved formatting of fraction numbers returned by exiv2.
        Patch by Martin SchmeiÃer <Waschbaehr gmx de>.



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	Fri Jan 11 18:25:30 2008
@@ -56,8 +56,9 @@
 		stringstream stream;
 		for (int i(0); i < res.size(); ++i) {
 			int a, b;
-			sscanf ( res[i].c_str(), "%d/%d", &a, &b);
+			if (sscanf ( res[i].c_str(), "%d/%d", &a, &b) == 2)
 			stream << (float)a/(float)b << " "; 
+			else stream << res[i] << " ";
 		}
 		value = stream.str() + value;
 		
@@ -127,7 +128,7 @@
 				string value = stream.str();
 
 				//disable "improve" untils it works :-)
-				metadata = add (metadata, i->key().c_str(), value.c_str(), cat);
+				metadata = add (metadata, i->key().c_str(), improve(value).c_str(), cat);
 			}
 		}
 



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