diff src/exif.c @ 176:695e1ad3b169

simplified exif.h, moved implementation-specific stuff to exif-int.h
author nadvornik
date Wed, 13 Feb 2008 13:57:31 +0000
parents 71e1ebee420e
children 0ca3b4c8ffae
line wrap: on
line diff
--- a/src/exif.c	Mon Feb 11 15:23:43 2008 +0000
+++ b/src/exif.c	Wed Feb 13 13:57:31 2008 +0000
@@ -68,7 +68,7 @@
 #include "intl.h"
 
 #include "gqview.h"
-#include "exif.h"
+#include "exif-int.h"
 
 #include "format_raw.h"
 #include "ui_fileops.h"
@@ -512,6 +512,29 @@
 	return item->marker->key;
 }
 
+guint exif_item_get_tag_id(ExifItem *item)
+{
+	return item->tag;
+}
+
+guint exif_item_get_elements(ExifItem *item)
+{
+	return item->elements;
+}
+
+char *exif_item_get_data(ExifItem *item, guint *data_len)
+{
+	if (data_len)
+		*data_len = item->data_len;
+	return item->data;
+}
+
+guint exif_item_get_format_id(ExifItem *item)
+{
+	return item->format;
+}
+
+
 const char *exif_item_get_description(ExifItem *item)
 {
 	if (!item || !item->marker) return NULL;
@@ -575,6 +598,7 @@
 	return result;
 }
 
+
 /*
  *-------------------------------------------------------------------
  * byte order utils
@@ -1122,6 +1146,32 @@
  *-------------------------------------------------------------------
  */
 
+
+ExifItem *exif_get_first_item(ExifData *exif)
+{
+	if (exif->items) 
+		{
+		ExifItem *ret = (ExifItem *)exif->items->data;
+		exif->current = exif->items->next;
+		return ret;
+		}
+	exif->current = NULL;
+	return NULL;
+}
+
+ExifItem *exif_get_next_item(ExifData *exif)
+{
+	if (exif->current) 
+		{
+		ExifItem *ret = (ExifItem *)exif->current->data;
+		exif->current = exif->current->next;
+		return ret;
+		}
+	return NULL;
+}
+
+
+
 static gint map_file(const gchar *path, void **mapping, int *size)
 {
 	int fd;
@@ -1201,6 +1251,7 @@
 
 	exif = g_new0(ExifData, 1);
 	exif->items = NULL;
+	exif->current = NULL;
 
 	if ((res = exif_jpeg_parse(exif, (unsigned char *)f, size,
 				   ExifKnownMarkersList,