Browse Source

Set software

Martijn Braam 1 year ago
parent
commit
59132aef90
2 changed files with 17 additions and 0 deletions
  1. 3 0
      include/libdng.h
  2. 14 0
      src/libdng.c

+ 3 - 0
include/libdng.h

@@ -50,6 +50,9 @@ libdng_set_mode_from_pixfmt(libdng_info *dng, uint32_t pixfmt);
 EXPORT int
 libdng_set_make_model(libdng_info *dng, const char *make, const char *model);
 
+EXPORT int
+libdng_set_software(libdng_info *dng, const char *software);
+
 EXPORT int
 libdng_set_datetime(libdng_info *dng, struct tm time);
 

+ 14 - 0
src/libdng.c

@@ -94,11 +94,25 @@ libdng_set_make_model(libdng_info *dng, const char *make, const char *model)
 	return 1;
 }
 
+int
+libdng_set_software(libdng_info *dng, const char *software)
+{
+	if (dng == NULL)
+		return 0;
+
+	dng->software = strdup(software);
+	return 1;
+}
+
 void
 libdng_free(libdng_info *dng)
 {
 	if (dng->camera_make != NULL)
 		free(dng->camera_make);
+	if (dng->camera_model != NULL)
+		free(dng->camera_model);
+	if (dng->software != NULL)
+		free(dng->software);
 }
 
 int