summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-07-05 22:02:25 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-07-05 22:02:25 +0200
commitc2a830a4bb5f23791c4131132a4b7efbf7c918c0 (patch)
tree41262235446df347df6f55cb00ea21b2296ee089 /src
parente46af065eb2f34f123b8dd40742d2d12baccbbb5 (diff)
fix tiff output path
Diffstat (limited to 'src')
-rw-r--r--src/gipfel.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 9409673..0e57b6a 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -8,6 +8,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
+#include <libgen.h>
#include <math.h>
#include <algorithm>
@@ -616,11 +617,11 @@ stitch(GipfelWidget::sample_mode_t m, int b_16,
char buf[1024];
char *dot;
- snprintf(buf, sizeof(buf), "%s/%s", path, argv[i]);
+ snprintf(buf, sizeof(buf), "%s/%s", path, basename(argv[i]));
dot = strrchr(buf, '.');
- if (dot) {
+ if (dot)
*dot = '\0';
- }
+
strncat(buf, ".tiff", sizeof(buf));
st->set_output(argv[i], new TIFFOutputImage(buf, b_16?16:8));