Commits

g3gg0 committed 539a425

added some new tags to dng code

  • Participants
  • Parent commits fc2e97d

Comments (0)

Files changed (2)

File src/chdk-dng.c

 static const int cam_BaselineSharpness[]       = {4,3};
 static const int cam_LinearResponseLimit[]     = {1,1};
 static const int cam_AnalogBalance[]           = {1,1,1,1,1,1};
+static char dng_lens_model[64]              = "";
+static char dng_image_desc[64]              = "";
 static char cam_name[32]                    = "Canikon";
 static char dng_artist_name[64]             = "";
 static char dng_copyright[64]               = "";
 }
 
 
-void dng_set_camname(char *name)
+void dng_set_camname(char *str)
 {
-    strncpy(cam_name, name, sizeof(cam_name));
+    strncpy(cam_name, str, sizeof(cam_name));
+}
+
+void dng_set_description(char *str)
+{
+    strncpy(dng_image_desc, str, sizeof(dng_image_desc));
+}
+
+void dng_set_lensmodel(char *str)
+{
+    strncpy(dng_lens_model, str, sizeof(dng_lens_model));
 }
 
 void dng_set_focal(int nom, int denom)
         {0x102,  T_SHORT,      3,  (int)cam_PreviewBitsPerSample},     // BitsPerSample: 8,8,8
         {0x103,  T_SHORT,      1,  1},                                 // Compression: Uncompressed
         {0x106,  T_SHORT,      1,  2},                                 // PhotometricInterpretation: RGB
-        {0x10E,  T_ASCII,      1,  0},                                 // ImageDescription
+        {0x10E,  T_ASCII,      sizeof(dng_image_desc), (int)dng_image_desc},               // ImageDescription
         {0x10F,  T_ASCII,      sizeof(CAM_MAKE), (int)CAM_MAKE},       // Make
         {0x110,  T_ASCII,      32, (int)cam_name},                     // Model: Filled at header generation.
         {0x111,  T_LONG,       1,  0},                                 // StripOffsets: Offset
         {0xC65A, T_SHORT,      1, 17},                                 // CalibrationIlluminant1 Standard Light A
         {0xC65B, T_SHORT,      1, 21},                                 // CalibrationIlluminant2 D65
         {0xC764, T_SRATIONAL,  1,  (int)cam_FrameRate},
+        {0xA434, T_ASCII,      sizeof(dng_lens_model), (int)dng_lens_model},               // Exif.Photo.LensModel - added to end so we don't have to update static array offsets
    1. g3gg0 author

      too bad, but right. then i would recommend looking up the tags to be modified and not to use hardcoded array offsets which is kinda ugly. (i know, that code was copied from another project)

     };
 
     struct dir_entry ifd1[]={

File src/chdk-dng.h

 void dng_set_framerate_rational(int nom, int denom);
 void dng_set_shutter(int nom, int denom);
 void dng_set_aperture(int nom, int denom);
-void dng_set_camname(char *name);
+void dng_set_camname(char *str);
+void dng_set_description(char *str);
+void dng_set_lensmodel(char *str);
 void dng_set_focal(int nom, int denom);
 void dng_set_iso(int value);