summaryrefslogtreecommitdiff
path: root/src/ExifImageMetaData.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-10-30 18:18:57 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-10-30 18:18:57 +0100
commitda5192170bb7ed19a8eadbc8ac393b0fa222c7df (patch)
tree534176e18b1cc6d8ac4f1926cb4c43c26168095b /src/ExifImageMetaData.cxx
parent20d0a75d72711a11694c4796529acba280ac9443 (diff)
consolidate ExifImageMetaData and src/JpgcomImageMetaData into ImageMetaData
Diffstat (limited to 'src/ExifImageMetaData.cxx')
-rw-r--r--src/ExifImageMetaData.cxx109
1 files changed, 0 insertions, 109 deletions
diff --git a/src/ExifImageMetaData.cxx b/src/ExifImageMetaData.cxx
deleted file mode 100644
index 4002e97..0000000
--- a/src/ExifImageMetaData.cxx
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// Copyright 2006 by Johannes Hofmann
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/wait.h>
-
-#include "util.h"
-
-#include "ExifImageMetaData.H"
-
-#define FOCAL_LENGTH_IN_35MM_FILM 0xa405
-#define GPS_LATIITUDE 0x0002
-#define GPS_LONGITUDE 0x0004
-#define GPS_ALTITUDE 0x0006
-
-
-static double
-degminsecstr2double(char *val) {
- double ret, dv;
-
- ret = 0.0;
- for (dv=1.0; dv <= 3600.0; dv = dv * 60.0) {
- ret = ret + atof(val) / dv;
- val = strchr(val, ',');
- if (!val || val[1] == '\0') {
- break;
- } else {
- val++;
- }
- }
-
- return ret;
-}
-
-
-int
-ExifImageMetaData::load_image(char *name) {
- char * args[32];
- FILE *p;
- pid_t pid;
- int status;
- char buf[1024];
- char val[1024];
- int id;
-
- args[0] = "exif";
- args[1] = "-i";
- args[2] = "-m";
- args[3] = name;
- args[4] = NULL;
-
- p = pexecvp(args[0], args, &pid, "r");
-
- if (p) {
- while (fgets(buf, sizeof(buf), p) != NULL) {
- if (sscanf(buf, "%x\t%[^\n]\n", &id, val) != 2) {
- continue;
- }
-
- switch(id) {
- case FOCAL_LENGTH_IN_35MM_FILM:
- focallength_sensor_ratio = atof(val) / 35.0;
- break;
- case GPS_LONGITUDE:
- longitude = degminsecstr2double(val);
- break;
- case GPS_LATIITUDE:
- latitude = degminsecstr2double(val);
- break;
- case GPS_ALTITUDE:
- height = atof(val);
- break;
- }
- }
- }
-
- fclose(p);
- waitpid(pid, &status, 0);
- if (WEXITSTATUS(status) == 127 || WEXITSTATUS(status) == 126) {
- fprintf(stderr, "%s not found\n", args[0]);
- }
-
- return 0;
-}
-
-
-int
-ExifImageMetaData::save_image(char *in_img, char *out_img) {
- return 1;
-}
-