Include a Other Software section in Help file
[geeqie.git] / src / metadata.c
index c3ffdbc..a4c7d02 100644 (file)
@@ -19,6 +19,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include <locale.h>
+
 #include "main.h"
 #include "metadata.h"
 
@@ -326,7 +328,9 @@ gboolean metadata_write_perform(FileData *fd)
                   (we can't wait until the sidecar is discovered by directory scanning because
                    exif_read_fd is called before that and it would read the main file only and
                    store the metadata in the cache)
-                   FIXME: this does not catch new sidecars created by independent external programs
+               */
+               /**
+               @FIXME this does not catch new sidecars created by independent external programs
                */
                file_data_unref(file_data_new_group(fd->change->dest));
 
@@ -668,7 +672,7 @@ GList *metadata_read_list(FileData *fd, const gchar *key, MetadataFormat format)
        const GList *cache_entry;
        if (!fd) return NULL;
 
-       /* unwritten data overide everything */
+       /* unwritten data override everything */
        if (fd->modified_xmp && format == METADATA_PLAIN)
                {
                list = g_hash_table_lookup(fd->modified_xmp, key);
@@ -709,6 +713,12 @@ GList *metadata_read_list(FileData *fd, const gchar *key, MetadataFormat format)
                {
                return g_list_append(NULL, metadata_file_info(fd, key, format));
                }
+#ifdef HAVE_LUA
+       else if (strncmp(key, "lua.", 4) == 0)
+               {
+               return g_list_append(NULL, metadata_lua_info(fd, key, format));
+               }
+#endif
 
        exif = exif_read_fd(fd); /* this is cached, thus inexpensive */
        if (!exif) return NULL;
@@ -853,6 +863,7 @@ gboolean metadata_write_GPS_coord(FileData *fd, const gchar *key, gdouble value)
        char *coordinate;
        char *ref;
        gboolean ok = TRUE;
+       char *old_locale, *saved_locale;
 
        param = value;
        if (param < 0)
@@ -877,8 +888,20 @@ gboolean metadata_write_GPS_coord(FileData *fd, const gchar *key, gdouble value)
 
        if (ok)
                {
+               /* Avoid locale problems with commas and decimal points in numbers */
+               old_locale = setlocale(LC_ALL, NULL);
+               saved_locale = strdup(old_locale);
+               if (saved_locale == NULL)
+                       {
+                       return FALSE;
+                       }
+               setlocale(LC_ALL, "C");
+
                coordinate = g_strdup_printf("%i,%lf,%s", deg, min, ref);
                metadata_write_string(fd, key, coordinate );
+
+               setlocale(LC_ALL, saved_locale);
+               free(saved_locale);
                g_free(coordinate);
                }
 
@@ -906,7 +929,7 @@ gboolean metadata_append_list(FileData *fd, const gchar *key, const GList *value
 }
 
 /**
- * \see find_string_in_list
+ * @see find_string_in_list
  */
 gchar *find_string_in_list_utf8nocase(GList *list, const gchar *string)
 {
@@ -939,7 +962,7 @@ gchar *find_string_in_list_utf8nocase(GList *list, const gchar *string)
 }
 
 /**
- * \see find_string_in_list
+ * @see find_string_in_list
  */
 gchar *find_string_in_list_utf8case(GList *list, const gchar *string)
 {
@@ -957,18 +980,18 @@ gchar *find_string_in_list_utf8case(GList *list, const gchar *string)
 } // gchar *find_string_in_list_utf...
 
 /**
- * \brief Find a existent string in a list.
+ * @brief Find a existent string in a list.
  *
  * This is a switch between find_string_in_list_utf8case and
  * find_string_in_list_utf8nocase to search with or without case for the
  * existence of a string.
  *
- * \param list The list to search in
- * \param string The string to search for
- * \return The string or NULL
+ * @param list The list to search in
+ * @param string The string to search for
+ * @return The string or NULL
  *
- * \see find_string_in_list_utf8case
- * \see find_string_in_list_utf8nocase
+ * @see find_string_in_list_utf8case
+ * @see find_string_in_list_utf8nocase
  */
 gchar *find_string_in_list(GList *list, const gchar *string)
 {
@@ -1024,7 +1047,7 @@ GList *string_to_keywords_list(const gchar *text)
 
 gboolean meta_data_get_keyword_mark(FileData *fd, gint n, gpointer data)
 {
-       /* FIXME: do not use global keyword_tree */
+       /** @FIXME do not use global keyword_tree */
        GList *path = data;
        GList *keywords;
        gboolean found = FALSE;