* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <locale.h>
+
#include "main.h"
#include "metadata.h"
(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));
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);
{
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;
char *coordinate;
char *ref;
gboolean ok = TRUE;
+ char *old_locale, *saved_locale;
param = value;
if (param < 0)
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);
}
}
/**
- * \see find_string_in_list
+ * @see find_string_in_list
*/
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)
{
} // 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)
{
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;