Permalink
Browse files

Support for Active D-Lightning

  • Loading branch information...
1 parent ad5aea8 commit 3c284dc81dcb26249114b7ecf32ed0000f492b8b @reald reald committed Mar 22, 2012
Showing with 66 additions and 0 deletions.
  1. +1 −0 src/exif_cfg.h
  2. +65 −0 src/exif_nikon.c
View
@@ -72,6 +72,7 @@ const unsigned int Exif_makernote_nikon_tag_list [] =
132, /* Lens */
171, /* Digital Vari-Program */
+ 34, /* ActiveD-Lighting */
183, /* AFInfo2 */
EXIF_NIKON_MAKERNOTE_END /* end marker */
View
@@ -100,6 +100,7 @@ static void exn_get_prim_af_pt(unsigned int phasedetectaf,
unsigned int primafpt,
char * buffer,
unsigned int maxsize);
+static void exn_get_mnote_nikon_34(ExifData *ed, char * buffer, unsigned int maxsize);
static void exn_get_mnote_nikon_168(ExifData *ed, char * buffer, unsigned int maxsize);
static void exn_get_mnote_nikon_183(ExifData *ed, char * buffer, unsigned int maxsize);
@@ -164,6 +165,63 @@ static void exn_get_prim_af_pt(unsigned int phasedetectaf,
+/* get ActiveD-Lighting (34) info */
+static void exn_get_mnote_nikon_34(ExifData *ed, char * buffer, unsigned int maxsize)
+{
+ char buf[EXIF_STD_BUF_LEN];
+ unsigned int data = 0;
+ char *answer;
+
+ buf[0] = '\0';
+ exif_get_mnote_tag(ed, 34, buf, sizeof(buf));
+ sscanf(buf, "(null): %u", &data);
+
+ switch(data)
+ {
+ case 0:
+ {
+ answer = "Off";
+ }
+ break;
+ case 1:
+ {
+ answer = "Low";
+ }
+ break;
+ case 3:
+ {
+ answer = "Normal";
+ }
+ break;
+ case 5:
+ {
+ answer = "High";
+ }
+ break;
+ case 7:
+ {
+ answer = "Extra High";
+ }
+ break;
+ case 65535:
+ {
+ answer = "Auto";
+ }
+ break;
+ default:
+ {
+ answer = "N/A"; /* this is not a nikon value */
+ }
+
+ }
+
+ snprintf(buffer + strlen(buffer), maxsize - strlen(buffer), "Active D-Lightning: %s\n",
+ answer);
+
+}
+
+
+
/* get nikon Flash info: control mode (168) info */
static void exn_get_mnote_nikon_168(ExifData *ed, char * buffer, unsigned int maxsize)
{
@@ -274,6 +332,13 @@ void exn_get_mnote_nikon_tags(ExifData *ed, unsigned int tag, char * buffer, uns
}
}
break;
+
+ case 34:
+ {
+ /* ActiveD-Lighting */
+ exn_get_mnote_nikon_34(ed, buffer + strlen(buffer), maxsize - strlen(buffer));
+ }
+ break;
case 168:
{

0 comments on commit 3c284dc

Please sign in to comment.