/*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2009 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
* 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"
#include "main.h"
#include "exif-int.h"
+#include "jpeg_parser.h"
#include "format_raw.h"
#include "ui_fileops.h"
return -2;
}
- if (exif_jpeg_segment_find(data, size, JPEG_MARKER_APP1,
+ if (jpeg_segment_find(data, size, JPEG_MARKER_APP1,
"Exif\x00\x00", 6,
&seg_offset, &seg_length))
{
}
+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
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;
}
gint exif_item_get_integer(ExifItem *item, gint *value)
{
if (!item) return FALSE;
+ if (!item->elements) return FALSE;
switch (item->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;
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);
}
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;
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;
}
void exif_free_preview(guchar *buf)
{
GList *work = exif_unmap_list;
-
+
while (work)
{
UnmapData *ud = (UnmapData *)work->data;