summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.cxx24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 44134f8..5570399 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <math.h>
@@ -69,7 +68,7 @@ GipfelWidget::GipfelWidget(int X,int Y,int W, int H): Fl_Widget(X, Y, W, H) {
fl_register_images();
}
-#define GIPFEL_FORMAT "gipfel: longitude %lf, latitude %lf, height %lf, direction %lf, nick %lf, tilt %lf, scale %lfi, projection type %d"
+#define GIPFEL_FORMAT "gipfel: longitude %lf, latitude %lf, height %lf, direction %lf, nick %lf, tilt %lf, scale %lf"
int
GipfelWidget::load_image(char *file) {
@@ -79,7 +78,6 @@ GipfelWidget::load_image(char *file) {
char buf[1024];
double lo, la, he, dir, ni, ti, sc;
int status;
- Projection_t pt = PROJECTION_TANGENTIAL;
Fl_Image *new_img;
new_img = new Fl_JPEG_Image(file);
@@ -117,7 +115,7 @@ GipfelWidget::load_image(char *file) {
if (p) {
while (fgets(buf, sizeof(buf), p) != NULL) {
- if (sscanf(buf, GIPFEL_FORMAT, &lo, &la, &he, &dir, &ni, &ti, &sc, &pt) >= 7) {
+ if (sscanf(buf, GIPFEL_FORMAT, &lo, &la, &he, &dir, &ni, &ti, &sc) == 7) {
set_view_long(lo);
set_view_lat(la);
set_view_height(he);
@@ -125,7 +123,6 @@ GipfelWidget::load_image(char *file) {
set_nick_angle(ni);
set_tilt_angle(ti);
set_scale(sc);
- set_projection(pt);
break;
}
@@ -148,26 +145,12 @@ GipfelWidget::save_image(char *file) {
char buf[1024];
int status;
size_t n;
- struct stat in_stat, out_stat;
if (img_file == NULL) {
fprintf(stderr, "Nothing to save\n");
return 1;
}
- if (stat(img_file, &in_stat) != 0) {
- perror("stat");
- return 1;
- }
-
- if (stat(file, &out_stat) == 0) {
- if (in_stat.st_ino == out_stat.st_ino) {
- fprintf(stderr, "Input image %s and output image %s are the same file\n",
- img_file, file);
- return 1;
- }
- }
-
out = fopen(file, "w");
if (out == NULL) {
perror("fopen");
@@ -181,8 +164,7 @@ GipfelWidget::save_image(char *file) {
get_center_angle(),
get_nick_angle(),
get_tilt_angle(),
- get_scale(),
- (int) get_projection());
+ get_scale());
// try to save gipfel data in JPEG comment section
args[0] = "wrjpgcom";