Enhancement: exposure comp in preview's image info (issue 954)

This commit is contained in:
michael
2011-08-31 20:38:33 -04:00
parent d76f3c38c5
commit 24d0a1657b
4 changed files with 50 additions and 18 deletions

View File

@@ -90,6 +90,7 @@ ImageData::ImageData (Glib::ustring fname, RawMetaDataLocation* ri) {
make = "Unknown";
model = "Unknown";
orientation = "Unknown";
expcomp = 0;
focal_len = 0;
memset (&time, 0, sizeof(time));
}
@@ -106,6 +107,7 @@ void ImageData::extractInfo () {
model = "";
serial = "";
orientation = "";
expcomp = 0;
shutter = 0;
aperture = 0;
focal_len = 0;
@@ -165,6 +167,8 @@ void ImageData::extractInfo () {
aperture = exif->getTag ("ApertureValue")->toDouble ();
if (exif->getTag ("FNumber"))
aperture = exif->getTag ("FNumber")->toDouble ();
if (exif->getTag ("ExposureBiasValue"))
expcomp = exif->getTag ("ExposureBiasValue")->toDouble ();
if (exif->getTag ("FocalLength"))
focal_len = exif->getTag ("FocalLength")->toDouble ();
if (exif->getTag ("ISOSpeedRatings"))
@@ -334,6 +338,17 @@ std::string ImageMetaData::shutterToString (double shutter) {
return buffer;
}
std::string ImageMetaData::expcompToString (double expcomp) {
char buffer[256];
if (expcomp!=0.0){
sprintf (buffer, "%0.1f", expcomp);
return buffer;
}
else
return "";
}
double ImageMetaData::shutterFromString (std::string s) {
int i = s.find_first_of ('/');