|
@@ -356,7 +356,7 @@ postprocess_setup()
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
-postprocess_internal(char *burst_dir, char *target_dir)
|
|
|
|
|
|
+postprocess_internal(char *burst_dir, char *target_dir, int keep)
|
|
{
|
|
{
|
|
struct dirent **namelist;
|
|
struct dirent **namelist;
|
|
int burst_size;
|
|
int burst_size;
|
|
@@ -381,7 +381,11 @@ postprocess_internal(char *burst_dir, char *target_dir)
|
|
while (burst_size--) {
|
|
while (burst_size--) {
|
|
fprintf(stderr, "DEBAYER %s\n", namelist[burst_size]->d_name);
|
|
fprintf(stderr, "DEBAYER %s\n", namelist[burst_size]->d_name);
|
|
snprintf(path, sizeof(path), "%s/%s", burst_dir, namelist[burst_size]->d_name);
|
|
snprintf(path, sizeof(path), "%s/%s", burst_dir, namelist[burst_size]->d_name);
|
|
- snprintf(outpath, sizeof(outpath), "%s.%d.jpg", target_dir, burst_size);
|
|
|
|
|
|
+ if(keep)
|
|
|
|
+ snprintf(outpath, sizeof(outpath), "%s.%d.jpg", target_dir, burst_size);
|
|
|
|
+ else
|
|
|
|
+ snprintf(outpath, sizeof(outpath), "%s.jpg", target_dir);
|
|
|
|
+
|
|
if (first) {
|
|
if (first) {
|
|
first = 0;
|
|
first = 0;
|
|
imagedata = read_exif(path);
|
|
imagedata = read_exif(path);
|
|
@@ -412,7 +416,11 @@ postprocess_internal(char *burst_dir, char *target_dir)
|
|
|
|
|
|
// Save the final file
|
|
// Save the final file
|
|
fprintf(stderr, "JPEG stacked.jpg\n");
|
|
fprintf(stderr, "JPEG stacked.jpg\n");
|
|
- snprintf(stackpath, sizeof(stackpath), "%s.stacked.jpg", target_dir);
|
|
|
|
|
|
+ if(keep)
|
|
|
|
+ snprintf(stackpath, sizeof(stackpath), "%s.stacked.jpg", target_dir);
|
|
|
|
+ else
|
|
|
|
+ snprintf(stackpath, sizeof(stackpath), "%s.jpg", target_dir);
|
|
|
|
+
|
|
save_jpeg(stackpath, stacked_data, 90, exif);
|
|
save_jpeg(stackpath, stacked_data, 90, exif);
|
|
}
|
|
}
|
|
|
|
|