X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fexif.c;h=872b9ccd65e54979ccc108845eb952b1af2975e1;hp=fe0c64f9339f1f0cd8029a79a278fe86642220d7;hb=50f5ef3cedbeaa251a1e838bf5045a9dc7dda1ee;hpb=af76525a87cc636cdf7f5454f4e32969ef903534 diff --git a/src/exif.c b/src/exif.c index fe0c64f9..872b9ccd 100644 --- a/src/exif.c +++ b/src/exif.c @@ -1,13 +1,22 @@ /* - * Geeqie - * (C) 2006 John Ellis - * Copyright (C) 2008 - 2010 The Geeqie Team + * Copyright (C) 2003, 2006 John Ellis + * Copyright (C) 2008 - 2016 The Geeqie Team * - * Authors: - * Support for Exif file format, originally written by Eric Swalens. - * Modified by Quy Tonthat + * Authors: Eric Swalens, Quy Tonthat * - * Reimplemented with generic data storage by John Ellis (Nov 2003) + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * The tags were added with information from the FREE document: * http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html @@ -34,22 +43,7 @@ * ComponentsConfiguration * UserComment (convert this to UTF-8?) * Add support for marker tag 0x0000 - * - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -1111,6 +1105,18 @@ guchar *exif_get_color_profile(ExifData *exif, guint *data_len) } +gchar* exif_get_image_comment(FileData* fd) +{ + log_printf("%s", _("Can't get image comment: not compiled with Exiv2.\n")); + return g_strdup(""); +} + +void exif_set_image_comment(FileData* fd, const gchar* comment) +{ + log_printf("%s", _("Can't set image comment: not compiled with Exiv2.\n")); +} + + /* *------------------------------------------------------------------- * misc @@ -1281,11 +1287,6 @@ ExifData *exif_read(gchar *path, gchar *sidecar_path, GHashTable *modified_xmp) if (exif) exif->items = g_list_reverse(exif->items); -#if 0 - exif_write_data_list(exif, stdout, TRUE); - exif_write_data_list(exif, stdout, FALSE); -#endif - return exif; } @@ -1604,12 +1605,12 @@ GList *exif_get_metadata(ExifData *exif, const gchar *key, MetadataFormat format { gchar *str; ExifItem *item; - + if (!key) return NULL; - + /* convert xmp key to exif key */ if (strcmp(key, "Xmp.tiff.Orientation") == 0) key = "Exif.Image.Orientation"; - + if (format == METADATA_FORMATTED) { gchar *text; @@ -1620,11 +1621,11 @@ GList *exif_get_metadata(ExifData *exif, const gchar *key, MetadataFormat format item = exif_get_item(exif, key); if (!item) return NULL; - + str = exif_item_get_data_as_text_full(item, format); - + if (!str) return NULL; - + return g_list_append(NULL, str); } @@ -1646,13 +1647,13 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, guchar *map_data; size_t map_len; int fd; - + if (!exif) return NULL; path = exif->path; fd = open(path, O_RDONLY); - - + + if (fd == -1) { return 0; @@ -1683,7 +1684,7 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, ud->ptr = map_data + offset; ud->map_data = map_data; ud->map_len = map_len; - + exif_unmap_list = g_list_prepend(exif_unmap_list, ud); return ud->ptr; } @@ -1696,7 +1697,7 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, void exif_free_preview(guchar *buf) { GList *work = exif_unmap_list; - + while (work) { UnmapData *ud = (UnmapData *)work->data;