commit after merge with trunk

This commit is contained in:
askv 2010-09-09 20:26:00 -07:00
parent 84ecfe412a
commit aa77b69443
18 changed files with 394 additions and 301 deletions

View File

@ -712,3 +712,13 @@ HISTOGRAM_BUTTON_L;L
###
CURVEEDITOR_NURBS;Control cage
###
MAIN_BUTTON_SAVE_TOOLTIP;Save current image <b>Ctrl+S</b>
MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Add current image to processing queue <b>Ctrl+Q</b>
MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor <b>Ctrl+E</b>
###
SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists

View File

@ -721,3 +721,6 @@ MAIN_BUTTON_SAVE_TOOLTIP;Save current image <b>Ctrl+S</b>
MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Add current image to processing queue <b>Ctrl+Q</b>
MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor <b>Ctrl+E</b>
###
SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists

View File

@ -723,3 +723,6 @@ MAIN_BUTTON_SAVE_TOOLTIP;Enregistrer l'image courante <b>Ctrl+S</b>
MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Ajouter l'image courante à la file de traitement <b>Ctrl+Q</b>
MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Éditer l'image courante dans l'éditeur externe <b>Ctrl+E</b>
###
SAVEDLG_AUTOSUFFIX;Ajouter automatiquement un suffixe si le fichier existe déjà

View File

@ -201,7 +201,16 @@ void ImProcCoordinator::updatePreviewImage (int todo) {
progress ("Conversion to RGB...",100*readyphase/numofphases);
if (todo!=CROP) {
previmg->getMutex().lock();
ipf.lab2rgb (nprevl, previmg);
try
{
ipf.lab2rgb (nprevl, previmg);
}
catch(char * str)
{
progress ("Error converting file...",0);
mProcessing.unlock ();
return;
}
previmg->getMutex().unlock();
}
if (!resultValid) {

View File

@ -38,6 +38,9 @@ extern const Settings* settings;
void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) {
if (chroma_scale == 0)
throw "Division by zero exception";
if (monitorTransform) {
int ix = 0;
short* buffer = new short [3*lab->W];

View File

@ -0,0 +1,43 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#include <rtengine.h>
#include <stdimagesource.h>
#include <rawimagesource.h>
namespace rtengine {
InitialImage* InitialImage::load (const Glib::ustring& fname, bool isRaw, int* errorCode, ProgressListener* pl) {
ImageSource* isrc;
if (!isRaw)
isrc = new StdImageSource ();
else
isrc = new RawImageSource ();
isrc->setProgressListener (pl);
*errorCode = isrc->load (fname);
if (*errorCode) {
delete isrc;
return NULL;
}
return isrc;
}
}

View File

@ -222,7 +222,7 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl) {
void startBatchProcessing (ProcessingJob* job, BatchProcessingListener* bpl) {
if (bpl)
Glib::Thread::create(sigc::bind(sigc::ptr_fun(batchProcessingThread), job, bpl), 0, false, true, Glib::THREAD_PRIORITY_NORMAL);
Glib::Thread::create(sigc::bind(sigc::ptr_fun(batchProcessingThread), job, bpl), 0, false, true, Glib::THREAD_PRIORITY_LOW);
}
}

View File

@ -197,14 +197,17 @@ rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) {
if (img && fname!="") {
int err = 0;
if (saveFormat.format=="tif")
err = img->saveAsTIFF (fname, saveFormat.tiffBits);
err = img->saveAsTIFF (fname, saveFormat.tiffBits,saveFormat.tiffUncompressed);
else if (saveFormat.format=="png")
err = img->saveAsPNG (fname, saveFormat.pngCompression, saveFormat.pngBits);
else if (saveFormat.format=="jpg")
err = img->saveAsJPEG (fname, saveFormat.jpegQuality);
img->free ();
if (!err && saveFormat.saveParams)
processing->params.save (removeExtension(fname) + paramFileExtension);
// We keep the extension to avoid overwriting the profile when we have
// the same output filename with different extension
//processing->params.save (removeExtension(fname) + paramFileExtension);
processing->params.save (fname + paramFileExtension);
if (processing->thumbnail) {
processing->thumbnail->imageDeveloped ();
processing->thumbnail->imageRemovedFromQueue ();

View File

@ -59,7 +59,7 @@ void BatchQueueEntryUpdater::process () {
if (stopped)
#undef THREAD_PRIORITY_NORMAL
thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::process_), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_NORMAL);
thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::process_), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_LOW);
}
void BatchQueueEntryUpdater::process_ () {

View File

@ -90,6 +90,7 @@ void Options::setDefaults () {
maxCacheEntries = 10000;
thumbnailFormat = FT_Custom16;
thumbInterp = 1;
autoSuffix = false;
saveParamsFile = false;
saveParamsCache = true;
paramsLoadLocation = PLL_Cache;
@ -198,6 +199,7 @@ if (keyFile.has_group ("Output")) {
if (keyFile.has_key ("Output", "Path")) savePathTemplate = keyFile.get_string ("Output", "Path");
if (keyFile.has_key ("Output", "PathTemplate")) savePathTemplate = keyFile.get_string ("Output", "PathTemplate");
if (keyFile.has_key ("Output", "PathFolder")) savePathFolder = keyFile.get_string ("Output", "PathFolder");
if (keyFile.has_key ("Output", "AutoSuffix")) autoSuffix = keyFile.get_boolean("Output", "AutoSuffix");
if (keyFile.has_key ("Output", "UsePathTemplate")) saveUsePathTemplate = keyFile.get_boolean("Output", "UsePathTemplate");
if (keyFile.has_key ("Output", "LastSaveAsPath")) lastSaveAsPath = keyFile.get_string ("Output", "LastSaveAsPath");
}
@ -357,6 +359,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_boolean ("Output", "SaveProcParams", saveFormat.saveParams);
keyFile.set_string ("Output", "PathTemplate", savePathTemplate);
keyFile.set_string ("Output", "PathFolder", savePathFolder);
keyFile.set_boolean("Output", "AutoSuffix", autoSuffix);
keyFile.set_boolean("Output", "UsePathTemplate", saveUsePathTemplate);
keyFile.set_string ("Output", "LastSaveAsPath", lastSaveAsPath);

View File

@ -95,6 +95,7 @@ class Options {
Glib::ustring language;
Glib::ustring theme;
static Glib::ustring cacheBaseDir;
bool autoSuffix;
bool saveParamsFile;
bool saveParamsCache;
PPLoadLocation paramsLoadLocation;

View File

@ -39,11 +39,7 @@ void PreviewWindow::on_realize () {
Gtk::DrawingArea::on_realize ();
add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK);
cCropMoving = new Gdk::Cursor (Gdk::FLEUR);
#ifdef _WIN32
cNormal = new Gdk::Cursor (Gdk::ARROW);
#else
cNormal = new Gdk::Cursor (Gdk::ARROW);
#endif
}
void PreviewWindow::getObservedFrameArea (int& x, int& y, int& w, int& h) {

View File

@ -22,6 +22,8 @@
extern Options options;
SaveAsDialog::SaveAsDialog (Glib::ustring initialDir) {
set_title(M("GENERAL_SAVE"));
Gtk::VBox* vbox = get_vbox ();
fchooser = new Gtk::FileChooserWidget (Gtk::FILE_CHOOSER_ACTION_SAVE);
@ -41,6 +43,16 @@ SaveAsDialog::SaveAsDialog (Glib::ustring initialDir) {
Gtk::HSeparator* hsep1 = new Gtk::HSeparator ();
vbox->pack_start (*hsep1, Gtk::PACK_SHRINK, 2);
// Unique filename option
// ~~~~~~~~~~~~~~~~~~~~~~
autoSuffix = new Gtk::CheckButton (M("SAVEDLG_AUTOSUFFIX"));
autoSuffix->set_active(options.autoSuffix);
vbox->pack_start (*autoSuffix, Gtk::PACK_SHRINK, 4);
Gtk::HSeparator* hsep2 = new Gtk::HSeparator ();
vbox->pack_start (*hsep2, Gtk::PACK_SHRINK, 2);
// Output Options
// ~~~~~~~~~~~~~~
formatOpts = new SaveFormatPanel ();
@ -49,8 +61,8 @@ SaveAsDialog::SaveAsDialog (Glib::ustring initialDir) {
vbox->pack_start (*formatOpts, Gtk::PACK_SHRINK, 4);
Gtk::HSeparator* hsep2 = new Gtk::HSeparator ();
vbox->pack_start (*hsep2, Gtk::PACK_SHRINK, 2);
Gtk::HSeparator* hsep3 = new Gtk::HSeparator ();
vbox->pack_start (*hsep3, Gtk::PACK_SHRINK, 2);
// queue/immediate
// ~~~~~~~~~~~~~
@ -83,6 +95,11 @@ SaveAsDialog::SaveAsDialog (Glib::ustring initialDir) {
show_all_children ();
}
bool SaveAsDialog::getAutoSuffix () {
return autoSuffix->get_active();
}
bool SaveAsDialog::getImmediately () {
return immediately->get_active ();

View File

@ -28,6 +28,7 @@ class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener {
protected:
Gtk::FileChooserWidget* fchooser;
Gtk::CheckButton* autoSuffix;
SaveFormatPanel* formatOpts;
Glib::ustring fname;
Gtk::FileFilter filter_jpg;
@ -43,6 +44,7 @@ class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener {
Glib::ustring getFileName ();
Glib::ustring getDirectory ();
SaveFormat getFormat ();
bool getAutoSuffix ();
bool getImmediately ();
bool getToHeadOfQueue ();
bool getToTailOfQueue ();

View File

@ -344,8 +344,8 @@ void ThumbBrowserEntryBase::draw () {
Glib::RefPtr<Gdk::GC> gc_ = Gdk::GC::create (w->get_window());
Gdk::Color textn = w->get_style()->get_text(Gtk::STATE_NORMAL);
Gdk::Color texts = w->get_style()->get_text(Gtk::STATE_SELECTED);
// Gdk::Color textn = w->get_style()->get_text(Gtk::STATE_NORMAL);
// Gdk::Color texts = w->get_style()->get_text(Gtk::STATE_SELECTED);
Gdk::Color bgn = w->get_style()->get_bg(Gtk::STATE_NORMAL);
Gdk::Color bgs = w->get_style()->get_bg(Gtk::STATE_SELECTED);