diff --git a/rtdata/languages/default b/rtdata/languages/default index ab63a8570..9338cd3f8 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -460,6 +460,7 @@ PREFERENCES_DMETHOD;Method PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EDITORLAYOUT;Editor Layout PREFERENCES_EXPOS;Exposure before interpolation\n :correction (lin) +PREFERENCES_PRESER;Exposure before interpolation\n :preserve highlights (EV) PREFERENCES_EXTERNALEDITOR;External editor PREFERENCES_FALSECOLOR;False color suppression steps PREFERENCES_FBROWSEROPTS;File Browser Options diff --git a/rtengine/hlmultipliers.cc b/rtengine/hlmultipliers.cc index 5f3271baa..57a455d6c 100644 --- a/rtengine/hlmultipliers.cc +++ b/rtengine/hlmultipliers.cc @@ -20,6 +20,7 @@ #include #include #include +#include #define MAXVAL 0xffff #define CLIP(a) ((a)>0?((a) #include #include +#include namespace rtengine { @@ -187,7 +188,8 @@ std::vector ICCStore::parseDir (Glib::ustring pdir) { if (!safe_file_test (fname, Glib::FILE_TEST_IS_DIR)) { int lastdot = sname.find_last_of ('.'); if (lastdot!=Glib::ustring::npos && lastdot<=(int)sname.size()-4 && (!sname.casefold().compare (lastdot, 4, ".icm") || !sname.casefold().compare (lastdot, 4, ".icc"))) { -// printf ("processing file %s...\n", fname.c_str()); + if( options.rtSettings.verbose ) + printf ("Processing ICC file: %s...\n", fname.c_str()); Glib::ustring name = sname.substr(0,lastdot); ProfileContent pc (fname); if (pc.data) { diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 41ab400c8..410c97c5c 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -690,6 +690,7 @@ int ImageIO::saveJPEG (Glib::ustring fname, int quality) { delete [] row; delete [] buffer; + fclose (file); if (pl) { diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 05837b741..65a989663 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -32,6 +32,57 @@ struct badPix badPix( int xc, int yc ):x(xc),y(yc){} }; +class PixelsMap{ + int w; // line width in base_t units + int h; // height + typedef unsigned long base_t; + static const size_t base_t_size=sizeof(base_t); + base_t *pm; + +public: + PixelsMap(int width, int height ) + :h(height){ + w = (width+base_t_size-1) /base_t_size; + pm = new base_t [h * w ]; + memset(pm,0,h * w *base_t_size ); + } + ~PixelsMap(){ + delete [] pm; + } + int width() const { return w; } + int height() const { return h; } + + // if a pixel is set returns true + bool get(int x, int y) + { + return (pm[y*w+ x/(base_t_size*8) ] & (base_t)1<<(x%(base_t_size*8)) )!=0; + } + + // set a pixel + void set(int x, int y) + { + pm[y*w+ x/(base_t_size*8) ] |= (base_t)1<<(x%(base_t_size*8)) ; + } + + // set pixels from a list + int set( std::list &bp) + { + int totSet=0; + for(std::list::iterator iter = bp.begin(); iter != bp.end(); iter++,totSet++) + set( iter->x,iter->y); + return totSet; + } + + void clear(){ + memset(pm,0,h * w *base_t_size ); + } + // return 0 if at least one pixel in the word(base_t) is set, otherwise return the number of pixels to skip to the next word base_t + int skipIfZero(int x, int y){ + return pm[y*w+ x/(base_t_size*8) ]==0 ? base_t_size*8 -x%(base_t_size*8):0; + } +}; + + class RawImage: public DCraw { public: diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 6505cf0ae..b7a6d743b 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -363,26 +363,28 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Image16* image, Previe /* cfaCleanFromMap: correct raw pixels looking at the bitmap * takes into consideration if there are multiple bad pixels in the neighborhood */ -int RawImageSource::cfaCleanFromMap( BYTE* bitmapBads ) +int RawImageSource::cfaCleanFromMap( PixelsMap &bitmapBads ) { float eps=1.0; - int bmpW= (W/8+ (W%8?1:0)); int counter=0; for( int row = 2; row < H-2; row++ ){ for(int col = 2; col thresh) continue; // mark the pixel as "bad" - bpMap[rr*bmpW+cc/8 ] |= 1<<(cc%8); + bpMap.set(cc,rr ); counter++; } return counter; @@ -829,7 +830,7 @@ int RawImageSource::load (Glib::ustring fname, bool batch) { plistener=NULL; // This must be reset, because only load() is called through progressConnector t2.set(); if( settings->verbose ) - printf("Load %s: %d µsec\n",fname.c_str(), t2.etime(t1)); + printf("Load %s: %d usec\n",fname.c_str(), t2.etime(t1)); return 0; // OK! } @@ -850,27 +851,26 @@ void RawImageSource::preprocess (const RAWParams &raw) printf( "Subtracting Darkframe:%s\n",rid->get_filename().c_str()); } copyOriginalPixels(ri, rid); - size_t widthBitmap = (W/8+ (W%8?1:0)); - size_t dimBitmap = widthBitmap*H; - - BYTE *bitmapBads = new BYTE [ dimBitmap ]; + 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("") ); if( bp ){ - for(std::list::iterator iter = bp->begin(); iter != bp->end(); iter++,totBP++) - bitmapBads[ widthBitmap * (iter->y) + (iter->x)/8] |= 1<<(iter->x%8); + totBP+=bitmapBads.set( *bp ); if( settings->verbose ){ std::cout << "Correcting " << bp->size() << " pixels from .badpixels" << std::endl; } } + + // 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()); }else if( raw.dark_frame.size()>0 ) bp = dfm.getHotPixels( raw.dark_frame ); if(bp){ - for(std::list::iterator iter = bp->begin(); iter != bp->end(); iter++,totBP++) - bitmapBads[ widthBitmap *iter->y + iter->x/8] |= 1<<(iter->x%8); + totBP+=bitmapBads.set( *bp ); if( settings->verbose && bp->size()>0){ std::cout << "Correcting " << bp->size() << " hotpixels from darkframe" << std::endl; } @@ -893,7 +893,6 @@ void RawImageSource::preprocess (const RAWParams &raw) } if( totBP ) cfaCleanFromMap( bitmapBads ); - delete [] bitmapBads; // check if it is an olympus E camera, if yes, compute G channel pre-compensation factors if ( raw.greenthresh || (((idata->getMake().size()>=7 && idata->getMake().substr(0,7)=="OLYMPUS" && idata->getModel()[0]=='E') || (idata->getMake().size()>=9 && idata->getMake().substr(0,7)=="Panasonic")) && raw.dmethod != RAWParams::methodstring[ RAWParams::vng4] && ri->isBayer()) ) { @@ -965,7 +964,7 @@ void RawImageSource::preprocess (const RAWParams &raw) t2.set(); if( settings->verbose ) - printf("Preprocessing: %d µsec\n", t2.etime(t1)); + printf("Preprocessing: %d usec\n", t2.etime(t1)); return; } void RawImageSource::demosaic(const RAWParams &raw) @@ -991,7 +990,7 @@ void RawImageSource::demosaic(const RAWParams &raw) nodemosaic(); t2.set(); if( settings->verbose ) - printf("Demosaicing: %s - %d µsec\n",raw.dmethod.c_str(), t2.etime(t1)); + printf("Demosaicing: %s - %d usec\n",raw.dmethod.c_str(), t2.etime(t1)); } if (plistener) { plistener->setProgressStr ("Ready."); @@ -2085,8 +2084,8 @@ int RawImageSource::getAEHistogram (unsigned int* histogram, int& histcompr) { bn = rn; } } - - printf ("AVG: %g %g %g\n", avg_r/rn, avg_g/gn, avg_b/bn); + if( settings->verbose ) + printf ("AVG: %g %g %g\n", avg_r/rn, avg_g/gn, avg_b/bn); // return ColorTemp (pow(avg_r/rn, 1.0/6.0)*img_r, pow(avg_g/gn, 1.0/6.0)*img_g, pow(avg_b/bn, 1.0/6.0)*img_b); diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 20995f486..d2a1f3fe4 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -152,8 +152,8 @@ class RawImageSource : public ImageSource { void CA_correct_RT (double cared, double cablue); void exp_bef (float expos, float preser);//exposi - int cfaCleanFromMap( BYTE* bitmapBads ); - int findHotDeadPixel( BYTE *bpMap, float thresh); + int cfaCleanFromMap( PixelsMap &bitmapBads ); + int findHotDeadPixel( PixelsMap &bpMap, float thresh); void ddct8x8s(int isgn, float **a); void cfa_linedn (float linenoiselevel);//Emil's line denoise diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index 5c27cb56b..a1568d85f 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -53,7 +53,9 @@ class CAApertureInterpreter : public Interpreter { CAApertureInterpreter () {} virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%0.1f", pow(2.0, t->toDouble()/64.0)); + double v = pow(2.0, t->toDouble()/64.0); + if( v<0. || v> 1000.) return "undef"; + sprintf (buffer, "%.1f",v ); return buffer; } }; @@ -74,7 +76,7 @@ public: int sec = t->toInt(0,SHORT); if( !sec ) return "OFF"; char buffer[32]; - sprintf (buffer, "%0.1fs %s", sec/10., sec&0x4000?",Custom":""); + sprintf (buffer, "%.1fs %s", sec/10., sec&0x4000?",Custom":""); return buffer; } }; @@ -392,9 +394,11 @@ class CAFocalInterpreter : public Interpreter { public: virtual std::string toString (Tag* t) { Tag *unitTag = t->getParent()->getRoot()->findTag("FocalUnits"); - double unit = unitTag->toDouble(); + double v = unitTag?unitTag->toDouble():1.; + v = (v>0. ? t->toDouble()/v : t->toDouble()); + if( v <0. || v>1000000.) return "undef"; char buffer[32]; - sprintf (buffer, "%0.1f", (unit>0. ? t->toDouble()/unit : t->toDouble())); + sprintf (buffer, "%.1f", v ); return buffer; } }; @@ -741,8 +745,8 @@ public: virtual std::string toString (Tag* t) { int val = t->toInt(); if( val <40 ) return "undef"; - char buffer[32]; - sprintf (buffer, "%0.2fmm", val *25.4 / 1000); + char buffer[1024]; + sprintf (buffer, "%.2fmm", val *25.4 / 1000); return buffer; } }; @@ -751,8 +755,9 @@ CAFocalPlaneInterpreter caFocalPlaneInterpreter; class CAExposureTimeInterpreter : public Interpreter { public: virtual std::string toString (Tag* t) { - char buffer[32]; - sprintf (buffer, "%0.3f", pow (2, - t->toInt()/32.0) ); + char buffer[1024]; + double d = pow (2, - t->toInt()/32.0); + sprintf (buffer, "%.3f", d); return buffer; } }; @@ -760,8 +765,8 @@ CAExposureTimeInterpreter caExposureTimeInterpreter; class CAEVInterpreter : public Interpreter { virtual std::string toString (Tag* t) { - char buffer[32]; - sprintf (buffer, "%0.1f", t->toDouble()/32.0 ); + char buffer[1024]; + sprintf (buffer, "%.1f", t->toDouble()/32.0 ); return buffer; } }; @@ -770,8 +775,8 @@ CAEVInterpreter caEVInterpreter; class CABaseISOInterpreter : public Interpreter { public: virtual std::string toString (Tag* t) { - char buffer[32]; - sprintf (buffer, "%0.0f", pow (2, t->toInt()/32.0 - 4) * 50 ); + char buffer[1024]; + sprintf (buffer, "%.0f", pow (2, t->toInt()/32.0 - 4) * 50 ); return buffer; } }; @@ -865,7 +870,7 @@ public: int n= t->toInt(); if( n==-1) return "undef"; char buffer[32]; - sprintf (buffer, "%0.f", n/32. ); + sprintf (buffer, "%.0f", n/32. ); return buffer; } }; @@ -911,8 +916,8 @@ CAControModeInterpreter caControModeInterpreter; class CAFocusDistanceInterpreter : public Interpreter { public: virtual std::string toString (Tag* t) { - char buffer[32]; - sprintf (buffer, "%0.2f", t->toDouble()/100 ); + char buffer[1024]; + sprintf (buffer, "%.2f", t->toDouble()/100 ); return buffer; } }; @@ -921,8 +926,8 @@ CAFocusDistanceInterpreter caFocusDistanceInterpreter; class CAMeasuredEVInterpreter : public Interpreter { public: virtual std::string toString (Tag* t) { - char buffer[32]; - sprintf (buffer, "%0.1f", t->toDouble()/8 - 6 ); + char buffer[1024]; + sprintf (buffer, "%.1f", t->toDouble()/8 - 6 ); return buffer; } }; diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 6574fba18..f5e0a9f3a 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -233,7 +233,9 @@ public: PAFNumberInterpreter () {} virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%0.1f", t->toDouble()/10); + double v = t->toDouble()/10; + if( v < 0. || v > 1000. ) return "undef"; + sprintf (buffer, "%.1f", v ); return buffer; } }; @@ -600,6 +602,7 @@ class PALensTypeInterpreter : public IntLensInterpreter< int > { choices.insert(p_t(256*6+ 13, "smc PENTAX-FA* 400mm f/5.6 ED[IF]")); choices.insert(p_t(256*6+ 14, "smc PENTAX-FA* MACRO 200mm f/4 ED[IF]")); choices.insert(p_t(256*7+ 0, "smc PENTAX-DA 21mm f/3.2 AL Limited")); + choices.insert(p_t(256*7+ 58, "smc PENTAX-D FA MACRO 100mm f/2.8 WR")); choices.insert(p_t(256*7+ 75, "Tamron SP AF 70-200mm f/2.8 Di LD [IF] Macro (A001)")); choices.insert(p_t(256*7+ 214, "smc PENTAX-DA 35mm f/2.4 AL")); choices.insert(p_t(256*7+ 216, "smc PENTAX-DA L 55-300mm f/4-5.8 ED")); @@ -708,7 +711,9 @@ class PAMaxApertureInterpreter: public Interpreter { a &= 0x7F; if(a>1){ char buffer[32]; - sprintf (buffer, "%0.1f", pow(2.0, (a-1)/32.0)); + double v = pow(2.0, (a-1)/32.0); + if( v < 0. || v > 1000. ) return "undef"; + sprintf (buffer, "%.1f", v ); return buffer; }else return "n/a"; @@ -724,7 +729,7 @@ public: int a = t->toInt(0,BYTE); int mina = a & 0x0F; int maxa = (a & 0xF0)>>4; - sprintf (buffer, "%0.1f - %0.0f", pow(2.0, maxa/4.0), pow(2.0, (mina+10)/4.0)); + sprintf (buffer, "%.1f - %.0f", pow(2.0, maxa/4.0), pow(2.0, (mina+10)/4.0)); return buffer; } @@ -819,9 +824,9 @@ class PAExternalFlashGNInterpreter: public Interpreter { public: PAExternalFlashGNInterpreter(){} virtual std::string toString (Tag* t) { - char buffer[32]; + char buffer[1024]; int b = t->toInt(0,BYTE) & 0x1F; - sprintf (buffer, "%0.0f", pow(2.,b/16.+4) ); + sprintf (buffer, "%.0f", pow(2.,b/16.+4) ); return buffer; } }; @@ -1032,7 +1037,7 @@ public: PADriveMode2Interpreter paDriveMode2Interpreter; const TagAttrib pentaxAttribs[] = { - {0, 1, 0, 0, 0x0001, "PentaxVersion", &stdInterpreter}, + {0, 1, 0, 0, 0x0000, "PentaxVersion", &stdInterpreter}, {0, 1, 0, 0, 0x0001, "PentaxModelType", &stdInterpreter}, {0, 2, 0, 0, 0x0002, "PreviewImageSize", &stdInterpreter}, {0, 2, 0, 0, 0x0003, "PreviewImageLength", &stdInterpreter}, diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 2935a7589..e143195b9 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -576,6 +576,8 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) int offsetFirst = 4; if( strstr(model, "*ist") || strstr(model, "GX-1") || strstr(model, "K100D") || strstr(model, "K110D") ) offsetFirst = 3; + if( strstr(model, "K-5") || strstr(model, "K-r") ) + offsetFirst = 12; directory = new TagDirectory*[2]; directory[1] = NULL; directory[0] = new TagDirectoryTable (parent, f, valuesize,offsetFirst,BYTE , attrib->subdirAttribs, getOrder()); @@ -812,7 +814,7 @@ void Tag::toString (char* buffer, int ofs) { } } else if (type==ASCII) { - sprintf (buffer, "%s", value+ofs); + sprintf (buffer, "%.64s", value+ofs); return; } @@ -831,8 +833,8 @@ void Tag::toString (char* buffer, int ofs) { case BYTE: sprintf (b, "%d", value[i+ofs]); break; case SSHORT: sprintf (b, "%d", toInt(2*i+ofs)); break; case SHORT: sprintf (b, "%u", toInt(2*i+ofs)); break; - case SLONG: sprintf (b, "%ld", toInt(4*i+ofs)); break; - case LONG: sprintf (b, "%lu", toInt(4*i+ofs)); break; + case SLONG: sprintf (b, "%ld", (long)toInt(4*i+ofs)); break; + case LONG: sprintf (b, "%lu", (unsigned long)toInt(4*i+ofs)); break; case SRATIONAL: case RATIONAL: sprintf (b, "%d/%d", (int)sget4 (value+8*i+ofs, getOrder()), (int)sget4 (value+8*i+ofs+4, getOrder())); break; case FLOAT: sprintf (b, "%g", toDouble(8*i+ofs)); break; @@ -844,7 +846,7 @@ void Tag::toString (char* buffer, int ofs) { std::string Tag::nameToString (int i) { - static char buffer[1024]; + char buffer[1024]; if (attrib) strcpy (buffer, attrib->name); else @@ -856,7 +858,7 @@ std::string Tag::nameToString (int i) { std::string Tag::valueToString () { - static char buffer[1024]; + char buffer[1024]; if (attrib && attrib->interpreter) return attrib->interpreter->toString (this); else { @@ -1110,7 +1112,7 @@ Tag* ExifManager::saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const cha void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) { - static char buffer[1024]; + char buffer[1024]; Tag* t; fseek (f, base+length-4, SEEK_SET); diff --git a/rtexif/stdattribs.cc b/rtexif/stdattribs.cc index fa97aa0bc..d5848d6ec 100644 --- a/rtexif/stdattribs.cc +++ b/rtexif/stdattribs.cc @@ -245,7 +245,9 @@ class FNumberInterpreter : public Interpreter { FNumberInterpreter () {} virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%0.1f", t->toDouble()); + double v = t->toDouble(); + if( v < 0. || v > 1000. ) return "undef"; + sprintf (buffer, "%0.1f", v); return buffer; } }; @@ -256,7 +258,9 @@ class ApertureInterpreter : public Interpreter { ApertureInterpreter () {} virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%0.1f", pow(2.0, t->toDouble()/2.0)); + double v = pow(2.0, t->toDouble()/2.0); + if( v < 0. || v > 1000. ) return "undef"; + sprintf (buffer, "%.1f", v ); return buffer; } }; @@ -267,7 +271,9 @@ class ExposureBiasInterpreter : public Interpreter { ExposureBiasInterpreter () {} virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%+0.2f", t->toDouble()); + double v = t->toDouble(); + if( v < -1000. || v > 1000. ) return "undef"; + sprintf (buffer, "%+0.2f", v ); return buffer; } }; @@ -277,12 +283,12 @@ class ShutterSpeedInterpreter : public Interpreter { public: ShutterSpeedInterpreter () {} virtual std::string toString (Tag* t) { - char buffer[32]; + char buffer[1024]; double d = pow (2.0, -t->toDouble()); if (d > 0.0 && d < 0.9) - sprintf (buffer, "1/%0.0f", 1.0 / d); + sprintf (buffer, "1/%.0f", 1.0 / d); else - sprintf (buffer, "%0.1f", d); + sprintf (buffer, "%.1f", d); return buffer; } }; @@ -292,12 +298,12 @@ class ExposureTimeInterpreter : public Interpreter { public: ExposureTimeInterpreter () {} virtual std::string toString (Tag* t) { - char buffer[32]; + char buffer[1024]; double d = t->toDouble(); if (d > 0.0 && d < 0.9) - sprintf (buffer, "1/%0.0f", 1.0 / d); + sprintf (buffer, "1/%.0f", 1.0 / d); else - sprintf (buffer, "%0.1f", d); + sprintf (buffer, "%.1f", d); return buffer; } }; @@ -308,7 +314,9 @@ class FocalLengthInterpreter : public Interpreter { FocalLengthInterpreter () {} virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%0.1f", t->toDouble()); + double v = t->toDouble(); + if( v>1000000. || v<0 ) return "undef"; + sprintf (buffer, "%.1f", v ); return buffer; } }; diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 6f53c8fca..ef6d01ba2 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -64,8 +64,8 @@ Glib::ustring getExtension (const Glib::ustring& filename) { void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int imh, int startx, int starty, double scale, const rtengine::procparams::CropParams& cparams) { - cr->set_line_width (0.7); - cr->rectangle (imx+0.5, imy+0.5, imw, imh); + cr->set_line_width (0.); + cr->rectangle (imx, imy, imw, imh); cr->clip (); double c1x = (cparams.x-startx)*scale; @@ -76,10 +76,10 @@ void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int cr->set_source_rgba (options.cutOverlayBrush[0], options.cutOverlayBrush[1], options.cutOverlayBrush[2], options.cutOverlayBrush[3]); // TODO: not sure if this is right. Seems to leave a thin border on the left/top, but might be bug in calling code - cr->rectangle (imx+0.5, imy+0.5, imw, c1y); - cr->rectangle (imx+0.5, imy+0.5+c2y, imw, imh-c2y); - cr->rectangle (imx+0.5, imy+0.5+c1y, c1x, c2y-c1y+1); - cr->rectangle (imx+0.5+c2x, imy+0.5+c1y, imw-c2x, c2y-c1y+1); + cr->rectangle (imx, imy, imw, c1y); + cr->rectangle (imx, imy+c2y, imw, imh-c2y); + cr->rectangle (imx, imy+c1y, c1x, c2y-c1y+1); + cr->rectangle (imx+c2x, imy+c1y, imw-c2x, c2y-c1y+1); cr->fill (); // rectangle around the cropped area and guides diff --git a/rtgui/main.cc b/rtgui/main.cc index 3176a9c83..bcf5a432c 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -134,6 +134,7 @@ int main(int argc, char **argv) m.run(*rtWindow); gdk_threads_leave (); delete rtWindow; + rtengine::cleanup(); return 0; } diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 0a192511e..b584cfee5 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -859,7 +859,10 @@ void Preferences::fillPreferences () { dateformat->set_text (moptions.dateFormat); if (safe_file_test (moptions.rtSettings.monitorProfile, Glib::FILE_TEST_EXISTS)) monProfile->set_filename (moptions.rtSettings.monitorProfile); - if (safe_file_test (moptions.rtSettings.iccDirectory, Glib::FILE_TEST_IS_DIR)) + if (moptions.rtSettings.monitorProfile.empty()) + monProfile->set_current_folder (moptions.rtSettings.iccDirectory); + + if (Glib::file_test (moptions.rtSettings.iccDirectory, Glib::FILE_TEST_IS_DIR)) iccDir->set_current_folder (moptions.rtSettings.iccDirectory); intent->set_active (moptions.rtSettings.colorimetricIntent); languages->set_active_text (moptions.language);