summaryrefslogtreecommitdiff
path: root/src/ImageMetaData.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-10-30 18:37:27 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-10-30 18:37:27 +0100
commit19bec8bde89fc08f6497a346b2121bcd96d1f528 (patch)
tree69b6677b273fc8062edfb70f2b38d545c56ad92d /src/ImageMetaData.cxx
parentda5192170bb7ed19a8eadbc8ac393b0fa222c7df (diff)
fix problem with compatibility code
Diffstat (limited to 'src/ImageMetaData.cxx')
-rw-r--r--src/ImageMetaData.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ImageMetaData.cxx b/src/ImageMetaData.cxx
index 424a792..d78493d 100644
--- a/src/ImageMetaData.cxx
+++ b/src/ImageMetaData.cxx
@@ -38,16 +38,19 @@ ImageMetaData::ImageMetaData() {
nick = 0.0;
tilt = 0.0;
focallength_sensor_ratio = 1.0;
- projection_type = 1;
+ scale = NAN;
+ projection_type = 0;
}
int
-ImageMetaData::load_image(char *name) {
+ImageMetaData::load_image(char *name, int img_width) {
int ret;
ret = load_image_jpgcom(name);
- if (ret != 0) {
+ if (ret == 2) { // old format
+ focallength_sensor_ratio = scale / (double) img_width;
+ } else if (ret == 1) { // get reasonable defaults from exif data
ret = load_image_exif(name);
}
@@ -179,7 +182,7 @@ ImageMetaData::load_image_jpgcom(char *name) {
direction = dir;
nick = ni;
tilt = ti;
- focallength_sensor_ratio = fr;
+ scale = fr;
projection_type = pt;
ret = 2; // special return value for compatibility with