/*
- * GQView
- * (C) 2005 John Ellis
+ * Geeqie
+ * (C) 2005 John Ellis
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Authors:
* Raw NEF jpeg extraction based on nefextract.c by Joseph Heled,
# include "config.h"
#endif
+#ifndef HAVE_EXIV2
#include <stdio.h>
#include <string.h>
#include "intl.h"
+#include "main.h"
#include "format_nikon.h"
#include "exif.h"
*-----------------------------------------------------------------------------
*/
-static guint nikon_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint nikon_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
gint level,
guint *image_offset, guint *jpeg_len);
-static void nikon_tiff_entry(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static void nikon_tiff_entry(guchar *data, const guint len, guint offset, ExifByteOrder bo,
gint level,
guint *image_offset, guint *image_length, guint *jpeg_start, guint *jpeg_len)
{
if (tag == 0x14a)
{
/* sub IFD table */
- gint i;
+ guint i;
for (i = 0; i < count; i++)
{
}
}
-static guint nikon_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+static guint nikon_tiff_table(guchar *data, const guint len, guint offset, ExifByteOrder bo,
gint level,
guint *image_offset, guint *image_length)
{
return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
}
-gint format_nikon_raw(unsigned char *data, const guint len,
- guint *image_offset, guint *exif_offset)
+gboolean format_nikon_raw(guchar *data, const guint len,
+ guint *image_offset, guint *exif_offset)
{
guint i_off = 0;
guint i_len = 0;
EXIF_TEXT_LIST_END
};
-#if 0
-static ExifTextList NikonTag[]= {
- { , "" },
- { , "" },
- EXIF_TEXT_LIST_END
-};
-#endif
-
static ExifMarker NikonExifMarkersList1[] = {
{ 0x0002, EXIF_FORMAT_STRING, 6, "Nikon.unknown", NULL, NULL },
{ 0x0003, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Nikon.Quality", "Quality", NikonTagQuality },
EXIF_TEXT_LIST_END
};
-#if 0
-static ExifTextList NikonTagi2Saturation[]= {
- { -3, "black and white" },
- { -2, "-2" },
- { -1, "-1" },
- { 0, "normal" },
- { 1, "+1" },
- { 2, "+2" },
- EXIF_TEXT_LIST_END
-};
-#endif
static ExifMarker NikonExifMarkersList2[] = {
{ 0x0002, EXIF_FORMAT_SHORT_UNSIGNED, 2, "Nikon.ISOSpeed", "ISO speed", NULL },
};
-gint format_nikon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
- guint size, ExifByteOrder bo)
+gboolean format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset,
+ guint size, ExifByteOrder bo)
{
- unsigned char *data;
+ guchar *data;
ExifItem *item;
if (offset + 8 + 4 >= size) return FALSE;
static ExifMarker marker = { 0x0088, EXIF_FORMAT_STRING, -1,
"Nikon.AutoFocusPoint", "Auto focus point", NULL };
guchar *array = item->data;
- const gchar *text;
+ gchar *text;
+ gint l;
text = exif_text_list_find_value(NikonAFPoint, (gint)array[1]);
- if (text)
- {
- gint l;
+ l = strlen(text) + 1;
- l = strlen(text) + 1;
- item = exif_item_new(marker.format, marker.tag, l, &marker);
- memcpy(item->data, text, l);
+ item = exif_item_new(marker.format, marker.tag, l, &marker);
+ memcpy(item->data, text, l);
- exif->items = g_list_prepend(exif->items, item);
- }
+ g_free(text);
+
+ exif->items = g_list_prepend(exif->items, item);
}
item = exif_get_item(exif, "Nikon.ISOSpeed");
return TRUE;
}
+#endif
+/* not HAVE_EXIV2 */
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */