Skip to content
This repository
Browse code

Support for Active D-Lightning

  • Loading branch information...
commit 3c284dc81dcb26249114b7ecf32ed0000f492b8b 1 parent ad5aea8
reald reald authored

Showing 2 changed files with 66 additions and 0 deletions. Show diff stats Hide diff stats

  1. +1 0  src/exif_cfg.h
  2. +65 0 src/exif_nikon.c
1  src/exif_cfg.h
@@ -72,6 +72,7 @@ const unsigned int Exif_makernote_nikon_tag_list [] =
72 72
73 73 132, /* Lens */
74 74 171, /* Digital Vari-Program */
  75 + 34, /* ActiveD-Lighting */
75 76 183, /* AFInfo2 */
76 77
77 78 EXIF_NIKON_MAKERNOTE_END /* end marker */
65 src/exif_nikon.c
@@ -100,6 +100,7 @@ static void exn_get_prim_af_pt(unsigned int phasedetectaf,
100 100 unsigned int primafpt,
101 101 char * buffer,
102 102 unsigned int maxsize);
  103 +static void exn_get_mnote_nikon_34(ExifData *ed, char * buffer, unsigned int maxsize);
103 104 static void exn_get_mnote_nikon_168(ExifData *ed, char * buffer, unsigned int maxsize);
104 105 static void exn_get_mnote_nikon_183(ExifData *ed, char * buffer, unsigned int maxsize);
105 106
@@ -164,6 +165,63 @@ static void exn_get_prim_af_pt(unsigned int phasedetectaf,
164 165
165 166
166 167
  168 +/* get ActiveD-Lighting (34) info */
  169 +static void exn_get_mnote_nikon_34(ExifData *ed, char * buffer, unsigned int maxsize)
  170 +{
  171 + char buf[EXIF_STD_BUF_LEN];
  172 + unsigned int data = 0;
  173 + char *answer;
  174 +
  175 + buf[0] = '\0';
  176 + exif_get_mnote_tag(ed, 34, buf, sizeof(buf));
  177 + sscanf(buf, "(null): %u", &data);
  178 +
  179 + switch(data)
  180 + {
  181 + case 0:
  182 + {
  183 + answer = "Off";
  184 + }
  185 + break;
  186 + case 1:
  187 + {
  188 + answer = "Low";
  189 + }
  190 + break;
  191 + case 3:
  192 + {
  193 + answer = "Normal";
  194 + }
  195 + break;
  196 + case 5:
  197 + {
  198 + answer = "High";
  199 + }
  200 + break;
  201 + case 7:
  202 + {
  203 + answer = "Extra High";
  204 + }
  205 + break;
  206 + case 65535:
  207 + {
  208 + answer = "Auto";
  209 + }
  210 + break;
  211 + default:
  212 + {
  213 + answer = "N/A"; /* this is not a nikon value */
  214 + }
  215 +
  216 + }
  217 +
  218 + snprintf(buffer + strlen(buffer), maxsize - strlen(buffer), "Active D-Lightning: %s\n",
  219 + answer);
  220 +
  221 +}
  222 +
  223 +
  224 +
167 225 /* get nikon Flash info: control mode (168) info */
168 226 static void exn_get_mnote_nikon_168(ExifData *ed, char * buffer, unsigned int maxsize)
169 227 {
@@ -274,6 +332,13 @@ void exn_get_mnote_nikon_tags(ExifData *ed, unsigned int tag, char * buffer, uns
274 332 }
275 333 }
276 334 break;
  335 +
  336 + case 34:
  337 + {
  338 + /* ActiveD-Lighting */
  339 + exn_get_mnote_nikon_34(ed, buffer + strlen(buffer), maxsize - strlen(buffer));
  340 + }
  341 + break;
277 342
278 343 case 168:
279 344 {

0 comments on commit 3c284dc

Please sign in to comment.
Something went wrong with that request. Please try again.