From 860e8037f078f61687eb65f008668a28589f013d Mon Sep 17 00:00:00 2001 From: ffsup2 Date: Sun, 30 Jan 2011 23:51:55 +0100 Subject: [PATCH] Improved GUI for FlatField and DarkFrame autoselection Added serial number in .badpixels file Added Pentax CameraInfo decoding (contains serial number) --- rtdata/languages/default | 1 + rtengine/dfmanager.cc | 17 +++++++++----- rtengine/ffmanager.cc | 14 ++++++++---- rtengine/imagedata.cc | 45 ++++++++++++++++++++++++++++++++++---- rtengine/imagedata.h | 5 ++++- rtengine/rawimagesource.cc | 12 +++++----- rtengine/rtengine.h | 2 ++ rtexif/pentaxattribs.cc | 9 +++++++- rtexif/rtexif.cc | 6 +++++ rtexif/rtexif.h | 1 + rtexif/stdattribs.cc | 8 +++++-- rtgui/editorpanel.cc | 2 +- rtgui/preprocess.cc | 24 +++++++++++++------- rtgui/toolpanelcoord.cc | 6 ++--- 14 files changed, 116 insertions(+), 36 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index dd69d0687..29a14a48a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -759,6 +759,7 @@ TP_PREPROCESS_FLATFIELDAUTOSELECT;Flat Field Auto Select TP_PREPROCESS_FLATFIELDBLURRADIUS;Flat Field Blur Radius TP_PREPROCESS_FLATFIELDBLURTYPE;Flat Field Blur Type TP_PREPROCESS_FLATFIELDFILE;Flat Field File +TP_PREPROCESS_NO_FOUND;None found TP_RAWPANEL_DEMOSAICING;Demosaicing TP_RAWPANEL_PREPROCESSING;Preprocessing TP_RESIZE_APPLIESTO;Applies to: diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 60e8bce84..e3b91ceff 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -25,6 +25,7 @@ #include #include #include +#include namespace rtengine{ @@ -260,20 +261,25 @@ dfInfo *DFManager::addFileInfo(const Glib::ustring &filename ) RawImage ri(filename); int res = ri.loadRaw(false); // Read informations about shot if( !res ){ + RawMetaDataLocation rml; + rml.exifBase = ri.get_exifBase(); + rml.ciffBase = ri.get_ciffBase(); + rml.ciffLength = ri.get_ciffLen(); + ImageData idata(filename, &rml); /* Files are added in the map, divided by same maker/model,ISO and shutter*/ - std::string key( dfInfo::key(ri.get_maker(), ri.get_model(),(int)ri.get_ISOspeed(),ri.get_shutter()) ); + std::string key( dfInfo::key(idata.getMake(), idata.getModel(),idata.getISOSpeed(),idata.getShutterSpeed()) ); dfList_t::iterator iter = dfList.find( key ); if( iter == dfList.end() ){ - dfInfo n(filename, ri.get_maker(), ri.get_model(),(int)ri.get_ISOspeed(),ri.get_shutter(),ri.get_timestamp()); + dfInfo n(filename, idata.getMake(), idata.getModel(),idata.getISOSpeed(),idata.getShutterSpeed(), idata.getDateTimeAsTS() ); iter = dfList.insert(std::pair< std::string,dfInfo>( key,n ) ); }else{ - while( iter != dfList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) >60*60*6 ) // 6 hour difference + while( iter != dfList.end() && iter->second.key() == key && ABS(iter->second.timestamp - idata.getDateTimeAsTS()) >60*60*6 ) // 6 hour difference iter++; if( iter != dfList.end() ) iter->second.pathNames.push_back( filename ); else{ - dfInfo n(filename, ri.get_maker(), ri.get_model(),(int)ri.get_ISOspeed(),ri.get_shutter(),ri.get_timestamp()); + dfInfo n(filename, idata.getMake(), idata.getModel(),idata.getISOSpeed(),idata.getShutterSpeed(),idata.getDateTimeAsTS()); iter = dfList.insert(std::pair< std::string,dfInfo>( key,n ) ); } } @@ -331,7 +337,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso bestMatch = iter; } } - return &(bestMatch->second); + return bestD != INFINITY ? &(bestMatch->second) : 0 ; } } @@ -399,6 +405,7 @@ int DFManager::scanBadPixelsFile( Glib::ustring filename ) int numPixels = bp.size(); if( numPixels >0 ) bpList[ makmodel ] = bp; + fclose(file); return numPixels; } diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index d669beb39..061b9eaeb 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -24,6 +24,7 @@ #include #include #include +#include namespace rtengine{ @@ -214,11 +215,16 @@ ffInfo *FFManager::addFileInfo(const Glib::ustring &filename ) RawImage ri(filename); int res = ri.loadRaw(false); // Read informations about shot if( !res ){ + RawMetaDataLocation rml; + rml.exifBase = ri.get_exifBase(); + rml.ciffBase = ri.get_ciffBase(); + rml.ciffLength = ri.get_ciffLen(); + ImageData idata(filename, &rml); /* Files are added in the map, divided by same maker/model,ISO and shutter*/ - std::string key( ffInfo::key(ri.get_maker(), ri.get_model(),(int)ri.get_ISOspeed(),ri.get_shutter(),ri.get_aperture()) ); + std::string key( ffInfo::key(idata.getMake(),idata.getModel(),idata.getISOSpeed(),idata.getShutterSpeed(),idata.getFNumber()) ); ffList_t::iterator iter = ffList.find( key ); if( iter == ffList.end() ){ - ffInfo n(filename, ri.get_maker(), ri.get_model(),(int)ri.get_ISOspeed(),ri.get_shutter(),ri.get_aperture(),ri.get_timestamp()); + ffInfo n(filename,idata.getMake(),idata.getModel(),idata.getISOSpeed(),idata.getShutterSpeed(),idata.getFNumber(),idata.getDateTimeAsTS()); iter = ffList.insert(std::pair< std::string,ffInfo>( key,n ) ); }else{ while( iter != ffList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) >60*60*6 ) // 6 hour difference @@ -227,7 +233,7 @@ ffInfo *FFManager::addFileInfo(const Glib::ustring &filename ) if( iter != ffList.end() ) iter->second.pathNames.push_back( filename ); else{ - ffInfo n(filename, ri.get_maker(), ri.get_model(),(int)ri.get_ISOspeed(),ri.get_shutter(),ri.get_aperture(),ri.get_timestamp()); + ffInfo n(filename,idata.getMake(),idata.getModel(),idata.getISOSpeed(),idata.getShutterSpeed(),idata.getFNumber(),idata.getDateTimeAsTS()); iter = ffList.insert(std::pair< std::string,ffInfo>( key,n ) ); } } @@ -285,7 +291,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, int iso bestMatch = iter; } } - return &(bestMatch->second); + return bestD != INFINITY ? &(bestMatch->second) : 0 ; } } diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 645e5e6d9..1ef912531 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -141,16 +141,47 @@ void ImageData::extractInfo () { make = ""; model = ""; + serial = ""; shutter = 0; aperture = 0; focal_len = 0; iso_speed = 0; memset (&time, 0, sizeof(time)); + timeStamp = 0; - if (root->getTag ("Make")) - make = root->getTag ("Make")->valueToString (); - if (root->getTag ("Model")) - model = root->getTag ("Model")->valueToString (); + if (root->getTag ("Make")){ + make = root->getTag ("Make")->valueToString (); + // same dcraw treatment + static const char *corp[] = + { "Canon", "NIKON", "EPSON", "KODAK", "Kodak", "OLYMPUS", "PENTAX", + "MINOLTA", "Minolta", "Konica", "CASIO", "Sinar", "Phase One", + "SAMSUNG", "Mamiya", "MOTOROLA" }; + for (int i=0; i < sizeof corp / sizeof *corp; i++) + if ( make.find( corp[i] ) != std::string::npos ){ /* Simplify company names */ + make = corp[i]; + break; + } + make.erase( make.find_last_not_of(' ')+1 ); + } + if (root->getTag ("Model")){ + model = root->getTag ("Model")->valueToString (); + std::size_t i=0; + if ( make.find("KODAK") != std::string::npos ){ + if( (i = model.find(" DIGITAL CAMERA")) != std::string::npos || + (i = model.find(" Digital Camera")) != std::string::npos || + (i = model.find("FILE VERSION")) ) + model.resize( i ); + } + + model.erase( model.find_last_not_of(' ')+1 ); + + //if( (i=model.find( make )) != std::string::npos ) + if( !strncasecmp (model.c_str(), make.c_str(), make.size()) ) + if( model.at( make.size() )==' ') + model.erase(0,make.size()+1); + if( model.find( "Digital Camera ") != std::string::npos ) + model.erase(0,15); + } rtexif::TagDirectory* exif = NULL; if (root->getTag ("Exif")) @@ -175,8 +206,14 @@ void ImageData::extractInfo () { if (sscanf ((const char*)exif->getTag("DateTimeOriginal")->getValue(), "%d:%d:%d %d:%d:%d", &time.tm_year, &time.tm_mon, &time.tm_mday, &time.tm_hour, &time.tm_min, &time.tm_sec) == 6) { time.tm_year -= 1900; time.tm_mon -= 1; + timeStamp = mktime(&time); } } + rtexif::Tag *snTag = exif->findTag ("SerialNumber"); + if(!snTag) + snTag = exif->findTag ("InternalSerialNumber"); + if ( snTag ) + serial = snTag->valueToString(); // guess lens... lens = "Unknown"; diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index c453ae353..967987a76 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -37,11 +37,12 @@ class ImageData : public ImageMetaData { IptcData* iptc; struct tm time; + time_t timeStamp; int iso_speed; double aperture; double focal_len; double shutter; - std::string make, model; + std::string make, model, serial; std::string lens; void extractInfo (); @@ -58,6 +59,7 @@ class ImageData : public ImageMetaData { bool hasIPTC () const { return iptc; } struct tm getDateTime () const { return time; } + time_t getDateTimeAsTS() const { return timeStamp; } int getISOSpeed () const { return iso_speed; } double getFNumber () const { return aperture; } double getFocalLen () const { return focal_len; } @@ -65,6 +67,7 @@ class ImageData : public ImageMetaData { std::string getMake () const { return make; } std::string getModel () const { return model; } std::string getLens () const { return lens; } + std::string getSerialNumber () const { return serial;} }; }; #endif diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index a3d6d1798..f6390f8f4 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -955,12 +955,11 @@ void RawImageSource::preprocess (const RAWParams &raw) if( raw.dark_frame.size()>0) rid = dfm.searchDarkFrame( raw.dark_frame ); } else { - rid = dfm.searchDarkFrame( ri->get_maker(), ri->get_model(), ri->get_ISOspeed(), ri->get_shutter(), ri->get_timestamp()); + rid = dfm.searchDarkFrame( idata->getMake(), idata->getModel(),idata->getISOSpeed(),idata->getShutterSpeed(),idata->getDateTimeAsTS()); } if( rid && settings->verbose){ printf( "Subtracting Darkframe:%s\n",rid->get_filename().c_str()); } - //copyOriginalPixels(ri, rid); //FLATFIELD start Glib::ustring newFF = raw.ff_file; @@ -969,7 +968,7 @@ void RawImageSource::preprocess (const RAWParams &raw) if( raw.ff_file.size()>0) rif = ffm.searchFlatField( raw.ff_file ); } else { - rif = ffm.searchFlatField( ri->get_maker(), ri->get_model(), ri->get_ISOspeed(), ri->get_shutter(), ri->get_aperture(), ri->get_timestamp()); + rif = ffm.searchFlatField( idata->getMake(), idata->getModel(),idata->getISOSpeed(),idata->getShutterSpeed(), idata->getFNumber(), idata->getDateTimeAsTS()); } if( rif && settings->verbose) { printf( "Flat Field Correction:%s\n",rif->get_filename().c_str()); @@ -978,12 +977,13 @@ void RawImageSource::preprocess (const RAWParams &raw) //FLATFIELD end - PixelsMap bitmapBads(W,H); int totBP=0; // Hold count of bad pixels to correct // Always correct camera badpixels - std::list *bp = dfm.getBadPixels( ri->get_maker(), ri->get_model(), std::string("") ); + std::list *bp = dfm.getBadPixels( idata->getMake(), idata->getModel(), idata->getSerialNumber() ); + if( !bp && !idata->getSerialNumber().empty() ) + bp = dfm.getBadPixels( idata->getMake(), idata->getModel(), "" ); // 2nd try without serial number if( bp ){ totBP+=bitmapBads.set( *bp ); if( settings->verbose ){ @@ -994,7 +994,7 @@ void RawImageSource::preprocess (const RAWParams &raw) // If darkframe selected, correct hotpixels found on darkframe bp = 0; if( raw.df_autoselect ){ - bp = dfm.getHotPixels( ri->get_maker(), ri->get_model(), ri->get_ISOspeed(), ri->get_shutter(), ri->get_timestamp()); + bp = dfm.getHotPixels( idata->getMake(), idata->getModel(),idata->getISOSpeed(),idata->getShutterSpeed(), idata->getDateTimeAsTS() ); }else if( raw.dark_frame.size()>0 ) bp = dfm.getHotPixels( raw.dark_frame ); if(bp){ diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 11488562f..a76f43541 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -60,6 +60,8 @@ namespace rtengine { virtual const std::vector getIPTCData () const =0; /** @return a struct containing the date and time of the image */ virtual struct tm getDateTime () const =0; + /** @return a timestamp containing the date and time of the image */ + virtual time_t getDateTimeAsTS() const =0; /** @return the ISO of the image */ virtual int getISOSpeed () const =0; /** @return the F number of the image */ diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index f5e0a9f3a..52d381dc9 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -1119,7 +1119,7 @@ const TagAttrib pentaxAttribs[] = { {0, 1, 0, 0, 0x0212, "WB_RGGBLevelsFluorescentN", &stdInterpreter}, {0, 1, 0, 0, 0x0213, "WB_RGGBLevelsFluorescentW", &stdInterpreter}, {0, 1, 0, 0, 0x0214, "WB_RGGBLevelsFlash", &stdInterpreter}, - {0, 1, 0, 0, 0x0215, "CameraInfo", &stdInterpreter}, + {0, 1, 0, pentaxCameraInfoAttribs, 0x0215, "CameraInfo", &stdInterpreter}, {0, 1, 0, pentaxBatteryInfoAttribs, 0x0216, "BatteryInfo", &stdInterpreter}, {0, 1, 0, 0, 0x021f, "AFInfo", &stdInterpreter}, {0, 1, 0, 0, 0x0222, "ColorInfo", &stdInterpreter}, @@ -1192,6 +1192,13 @@ const TagAttrib pentaxBatteryInfoAttribs[] = { {0, 1, 0, 0, 5, "BatteryADGripLoad", &stdInterpreter}, {-1, 0, 0, 0, 0, "", NULL}}; +const TagAttrib pentaxCameraInfoAttribs[] = { + {0, 1, 0, 0, 0, "PentaxModelID", &stdInterpreter}, + {0, 1, 0, 0, 1, "ManufactureDate", &stdInterpreter}, + {0, 1, 0, 0, 2, "ProductionCode", &stdInterpreter}, + {0, 1, 0, 0, 4, "InternalSerialNumber", &stdInterpreter}, + {-1, 0, 0, 0, 0, "", NULL}}; + }; #endif diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index e143195b9..e296bf7f9 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -569,6 +569,12 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) directory = new TagDirectory*[2]; directory[1] = NULL; directory[0] = new TagDirectoryTable (parent, f, valuesize,0,BYTE , attrib->subdirAttribs, getOrder()); + makerNoteKind = TABLESUBDIR; + break; + case 0x0215: + directory = new TagDirectory*[2]; + directory[1] = NULL; + directory[0] = new TagDirectoryTable (parent, f, valuesize,0,LONG , attrib->subdirAttribs, getOrder()); makerNoteKind = TABLESUBDIR; break; case 0x0207: diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index b898ac975..5d5633683 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -355,6 +355,7 @@ extern const TagAttrib pentaxCameraSettingsAttribs[]; extern const TagAttrib pentaxFlashInfoAttribs[]; extern const TagAttrib pentaxSRInfoAttribs[]; extern const TagAttrib pentaxBatteryInfoAttribs[]; +extern const TagAttrib pentaxCameraInfoAttribs[]; extern const TagAttrib fujiAttribs[]; extern const TagAttrib minoltaAttribs[]; extern const TagAttrib sonyAttribs[]; diff --git a/rtexif/stdattribs.cc b/rtexif/stdattribs.cc index d5848d6ec..ea55fa0fb 100644 --- a/rtexif/stdattribs.cc +++ b/rtexif/stdattribs.cc @@ -455,8 +455,12 @@ const TagAttrib exifAttribs[] = { {0, 1, 0, 0, 0xA40B, "DeviceSettingDescription", &stdInterpreter}, {0, 1, 0, 0, 0xA40C, "SubjectDistanceRange", &stdInterpreter}, {0, 1, 0, 0, 0xA420, "ImageUniqueID", &stdInterpreter}, - {0, 1, 0, 0, 0xa432, "LensInfo", &stdInterpreter}, - {0, 1, 0, 0, 0xa434, "LensModel", &stdInterpreter}, + {0, 1, 0, 0, 0xA431, "SerialNumber", &stdInterpreter}, + {0, 1, 0, 0, 0xA432, "LensInfo", &stdInterpreter}, + {0, 1, 0, 0, 0xA433, "LensMake", &stdInterpreter}, + {0, 1, 0, 0, 0xA434, "LensModel", &stdInterpreter}, + {0, 1, 0, 0, 0xA435, "LensSerialNumber", &stdInterpreter}, + {0, 1, 0, 0, 0xc630, "DNGLensInfo", &stdInterpreter}, {-1, 0, 0, 0, 0, "", NULL }}; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 3b062ae52..6fbdffbd4 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -671,7 +671,7 @@ void EditorPanel::info_toggled () { // + Glib::ustring::compose ("%1: %2", M("QINFO_LENS"), Glib::ustring(idata->getLens())); infoString = Glib::ustring::compose ( "%1 + %2\nf/%3 %4s %5%6 %7mm\n%8", - Glib::ustring(idata->getModel()), + Glib::ustring(idata->getMake()+" "+idata->getModel()), Glib::ustring(idata->getLens()), Glib::ustring(idata->apertureToString(idata->getFNumber())), Glib::ustring(idata->shutterToString(idata->getShutterSpeed())), diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index d34310e03..5556603c4 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -36,7 +36,7 @@ PreProcess::PreProcess () hbdf->pack_start(*darkFrameFile); hbdf->pack_start(*btnReset, Gtk::PACK_SHRINK, 4); dfAuto = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_DFAUTOSELECT")))); - dfInfo = Gtk::manage(new Gtk::Label(".")); + dfInfo = Gtk::manage(new Gtk::Label("")); dfInfo->set_alignment(0,0); //left align hbff = Gtk::manage(new Gtk::HBox()); @@ -48,7 +48,7 @@ PreProcess::PreProcess () hbff->pack_start(*flatFieldFile); hbff->pack_start(*flatFieldFileReset, Gtk::PACK_SHRINK, 4); flatFieldAutoSelect = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_FLATFIELDAUTOSELECT")))); - ffInfo = Gtk::manage(new Gtk::Label(".")); + ffInfo = Gtk::manage(new Gtk::Label("")); ffInfo->set_alignment(0,0); //left align flatFieldBlurRadius = Gtk::manage(new Adjuster (M("PREFERENCES_FLATFIELDBLURRADIUS"),0,200,2,32)); flatFieldBlurRadius->setAdjusterListener (this); @@ -176,25 +176,29 @@ void PreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEd lastHot = pp->raw.hotdeadpix_filt; lastDFauto = pp->raw.df_autoselect; - if( pp->raw.df_autoselect && dfp){ + if( pp->raw.df_autoselect && dfp && !batchMode){ // retrieve the auto-selected df filename rtengine::RawImage *img = dfp->getDF(); if( img ){ std::ostringstream s; s << Glib::path_get_basename(img->get_filename()) << ":" <get_ISOspeed() << "ISO " << img->get_shutter() << "s"; dfInfo->set_text( s.str() ); + }else{ + dfInfo->set_text(Glib::ustring(M("TP_PREPROCESS_NO_FOUND"))); } } else dfInfo->set_text(""); lastFFAutoSelect = pp->raw.ff_AutoSelect; - if( pp->raw.ff_AutoSelect && ffp){ + if( pp->raw.ff_AutoSelect && ffp && !batchMode){ // retrieve the auto-selected ff filename rtengine::RawImage *img = ffp->getFF(); if( img ){ std::ostringstream s; - s << Glib::path_get_basename(img->get_filename()) << ":" <get_ISOspeed() << "ISO " << img->get_shutter() << "s"; + s << Glib::path_get_basename(img->get_filename()) << ":" <get_ISOspeed() << "ISO f/" << img->get_aperture(); ffInfo->set_text( s.str() ); + }else{ + ffInfo->set_text(Glib::ustring(M("TP_PREPROCESS_NO_FOUND"))); } } else ffInfo->set_text(""); @@ -366,14 +370,16 @@ void PreProcess::dfAutoChanged() lastDFauto = dfAuto->get_active (); } - if(dfAuto->get_active() && dfp){ + if(dfAuto->get_active() && dfp && !batchMode){ // retrieve the auto-selected df filename rtengine::RawImage *img = dfp->getDF(); if( img ){ std::ostringstream s; s << Glib::path_get_basename(img->get_filename()) << ":" <get_ISOspeed() << "ISO " << img->get_shutter() << "s"; dfInfo->set_text( s.str() ); - } + }else{ + dfInfo->set_text(Glib::ustring(M("TP_PREPROCESS_NO_FOUND"))); + } } else{dfInfo->set_text("");} @@ -472,13 +478,15 @@ void PreProcess::flatFieldAutoSelectChanged() } hbff->set_sensitive( !flatFieldAutoSelect->get_active() ); - if( flatFieldAutoSelect->get_active() && ffp){ + if( flatFieldAutoSelect->get_active() && ffp && !batchMode){ // retrieve the auto-selected ff filename rtengine::RawImage *img = ffp->getFF(); if( img ){ std::ostringstream s; s << Glib::path_get_basename(img->get_filename()) << ":" <get_ISOspeed() << "ISO " << img->get_shutter() << "s"; ffInfo->set_text( s.str() ); + }else{ + ffInfo->set_text(Glib::ustring(M("TP_PREPROCESS_NO_FOUND"))); } } else{ffInfo->set_text("");} diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index afb3c1aa4..643b8464b 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -408,8 +408,7 @@ rtengine::RawImage* ToolPanelCoordinator::getDF() double shutter = imd->getShutterSpeed(); std::string maker( imd->getMake() ); std::string model( imd->getModel() ); - tm t =imd->getDateTime(); - time_t timestamp = mktime(&t); + time_t timestamp = imd->getDateTimeAsTS(); return rtengine::dfm.searchDarkFrame( maker,model,iso,shutter, timestamp); } @@ -427,8 +426,7 @@ rtengine::RawImage* ToolPanelCoordinator::getFF() double aperture = imd->getFNumber(); std::string maker( imd->getMake() ); std::string model( imd->getModel() ); - tm t =imd->getDateTime(); - time_t timestamp = mktime(&t); + time_t timestamp = imd->getDateTimeAsTS(); return rtengine::ffm.searchFlatField( maker,model,iso,shutter,aperture,timestamp); }