diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 6385a3d83..47b9daeaf 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -364,8 +364,8 @@ rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) { SaveFormat saveFormat; if (processing->outFileName=="") { // auto file name Glib::ustring s = calcAutoFileNameBase (processing->filename); - fname = autoCompleteFileName (s, options.saveFormat.format); - saveFormat = options.saveFormat; + saveFormat = options.saveFormatBatch; + fname = autoCompleteFileName (s, saveFormat.format); } else { // use the save-as filename with automatic completion for uniqueness fname = autoCompleteFileName (removeExtension(processing->outFileName), getExtension(processing->outFileName)); diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index 247bcc0ec..997e6f79f 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -78,7 +78,7 @@ BatchQueuePanel::BatchQueuePanel () { saveFormatPanel = Gtk::manage (new SaveFormatPanel ()); fformat->add (*saveFormatPanel); - saveFormatPanel->init (options.saveFormat); + saveFormatPanel->init (options.saveFormatBatch); outdirTemplate->set_text (options.savePathTemplate); if (safe_file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) outdirFolder->set_current_folder (options.savePathFolder); @@ -264,6 +264,6 @@ void BatchQueuePanel::pathFolderChanged () { void BatchQueuePanel::formatChanged (Glib::ustring f) { - options.saveFormat = saveFormatPanel->getFormat (); + options.saveFormatBatch = saveFormatPanel->getFormat (); } diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 3fcbaa2ee..8658b7e01 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -726,7 +726,7 @@ void FileCatalog::deleteRequested (std::vector tbe, bool inc safe_g_remove (Glib::ustring(removeExtension(fname)+".THM")); if (inclBatchProcessed) { - Glib::ustring procfName = Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormat.format); + Glib::ustring procfName = Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormatBatch.format); if (safe_file_test (procfName, Glib::FILE_TEST_EXISTS)) safe_g_remove (procfName); } } diff --git a/rtgui/options.cc b/rtgui/options.cc index dfbd2ebf9..02ebd3f79 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -58,6 +58,15 @@ void Options::setDefaults () { saveFormat.tiffBits = 8; saveFormat.tiffUncompressed = true; saveFormat.saveParams = true; // was false + + saveFormatBatch.format = "jpg"; + saveFormatBatch.jpegQuality = 100; + saveFormatBatch.pngCompression = 6; + saveFormatBatch.pngBits = 8; + saveFormatBatch.tiffBits = 8; + saveFormatBatch.tiffUncompressed = true; + saveFormatBatch.saveParams = true; // was false + savePathTemplate = "%p1/converted/%f"; savePathFolder = ""; saveUsePathTemplate = true; @@ -294,6 +303,16 @@ if (keyFile.has_group ("Output")) { if (keyFile.has_key ("Output", "TiffBps")) saveFormat.tiffBits = keyFile.get_integer ("Output", "TiffBps"); if (keyFile.has_key ("Output", "TiffUncompressed")) saveFormat.tiffUncompressed= keyFile.get_boolean ("Output", "TiffUncompressed"); if (keyFile.has_key ("Output", "SaveProcParams")) saveFormat.saveParams = keyFile.get_boolean ("Output", "SaveProcParams"); + + + if (keyFile.has_key ("Output", "FormatBatch")) saveFormatBatch.format = keyFile.get_string ("Output", "FormatBatch"); + if (keyFile.has_key ("Output", "JpegQualityBatch")) saveFormatBatch.jpegQuality = keyFile.get_integer ("Output", "JpegQualityBatch"); + if (keyFile.has_key ("Output", "PngCompressionBatch")) saveFormatBatch.pngCompression = keyFile.get_integer ("Output", "PngCompressionBatch"); + if (keyFile.has_key ("Output", "PngBpsBatch")) saveFormatBatch.pngBits = keyFile.get_integer ("Output", "PngBpsBatch"); + if (keyFile.has_key ("Output", "TiffBpsBatch")) saveFormatBatch.tiffBits = keyFile.get_integer ("Output", "TiffBpsBatch"); + if (keyFile.has_key ("Output", "TiffUncompressedBatch")) saveFormatBatch.tiffUncompressed= keyFile.get_boolean ("Output", "TiffUncompressedBatch"); + if (keyFile.has_key ("Output", "SaveProcParamsBatch")) saveFormatBatch.saveParams = keyFile.get_boolean ("Output", "SaveProcParamsBatch"); + 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"); @@ -493,6 +512,15 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_integer ("Output", "TiffBps", saveFormat.tiffBits); keyFile.set_boolean ("Output", "TiffUncompressed", saveFormat.tiffUncompressed); keyFile.set_boolean ("Output", "SaveProcParams", saveFormat.saveParams); + + keyFile.set_string ("Output", "FormatBatch", saveFormatBatch.format); + keyFile.set_integer ("Output", "JpegQualityBatch", saveFormatBatch.jpegQuality); + keyFile.set_integer ("Output", "PngCompressionBatch", saveFormatBatch.pngCompression); + keyFile.set_integer ("Output", "PngBpsBatch", saveFormatBatch.pngBits); + keyFile.set_integer ("Output", "TiffBpsBatch", saveFormatBatch.tiffBits); + keyFile.set_boolean ("Output", "TiffUncompressedBatch", saveFormatBatch.tiffUncompressed); + keyFile.set_boolean ("Output", "SaveProcParamsBatch", saveFormatBatch.saveParams); + keyFile.set_string ("Output", "PathTemplate", savePathTemplate); keyFile.set_string ("Output", "PathFolder", savePathFolder); keyFile.set_boolean ("Output", "AutoSuffix", autoSuffix); diff --git a/rtgui/options.h b/rtgui/options.h index b7a5d778f..65ab35300 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -51,7 +51,7 @@ class Options { public: bool firstRun; bool savesParamsAtExit; - SaveFormat saveFormat; + SaveFormat saveFormat,saveFormatBatch; Glib::ustring savePathTemplate; Glib::ustring savePathFolder; bool saveUsePathTemplate; diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 2f427bf3b..79666d1ad 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -702,7 +702,7 @@ bool Thumbnail::openDefaultViewer(int destination) { Glib::ustring openFName; if (destination==1) { - openFName = Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormat.format); + openFName = Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormatBatch.format); if (safe_file_test (openFName, Glib::FILE_TEST_EXISTS)) { wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (openFName.c_str(), -1, NULL, NULL, NULL); ShellExecuteW(NULL, L"open", wfilename, NULL, NULL, SW_SHOWMAXIMIZED ); @@ -713,7 +713,7 @@ bool Thumbnail::openDefaultViewer(int destination) { } } else { openFName = destination == 3 ? fname - : Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormat.format); + : Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormatBatch.format); printf("Opening %s\n", openFName.c_str());