Browse Source

Fixed buffer overflow and postprocessing metadata

Martijn Braam 4 years ago
parent
commit
b7d43be635
2 changed files with 11 additions and 1 deletions
  1. 1 1
      main.c
  2. 10 0
      postprocess.sh

+ 1 - 1
main.c

@@ -90,7 +90,7 @@ static char *last_path = NULL;
 static int auto_exposure = 1;
 static int auto_exposure = 1;
 static int auto_gain = 1;
 static int auto_gain = 1;
 static int burst_length = 5;
 static int burst_length = 5;
-static char burst_dir[20];
+static char burst_dir[23];
 static char processing_script[512];
 static char processing_script[512];
 
 
 // Widgets
 // Widgets

+ 10 - 0
postprocess.sh

@@ -45,6 +45,16 @@ if [ -n "$DCRAW" ]; then
 	if command -v convert &> /dev/null
 	if command -v convert &> /dev/null
 	then
 	then
 		convert "$BURST_DIR"/1.dng.tiff "$TARGET_NAME.jpg"
 		convert "$BURST_DIR"/1.dng.tiff "$TARGET_NAME.jpg"
+
+		# If exiftool is installed copy the exif data over from the tiff to the jpeg
+		# since imagemagick is stupid
+		if command -v exiftool &> /dev/null
+		then
+			exiftool -tagsFromfile "$BURST_DIR"/1.dng.tiff \
+				 -software="Megapixels" \
+				 -overwrite_original "$TARGET_NAME.jpg"
+		fi
+
 	else
 	else
 		cp "$BURST_DIR"/1.dng.tiff "$TARGET_NAME.tiff"
 		cp "$BURST_DIR"/1.dng.tiff "$TARGET_NAME.tiff"
 	fi
 	fi