diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) new file mode 100644 index 000000000..3317fdd82 --- /dev/null +++ b/rtdata/languages/English (US) @@ -0,0 +1,19 @@ +# +# This file is part of RawTherapee. +# +# Copyright (c) 2004-2010 Gabor Horvath +# +# 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 . +# + diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 761ba7eca..e2523a3c9 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef RAWZOR_SUPPORT #include #endif @@ -278,27 +279,6 @@ ImageData::~ImageData () { iptc_data_free (iptc); } -Glib::ustring safe_locale_to_utf8 (const std::string& src) -{ - Glib::ustring utf8_str; -#ifdef GLIBMM_EXCEPTIONS_ENABLED - try { - utf8_str = Glib::locale_to_utf8(src); - } - catch (const Glib::ConvertError& e) { - utf8_str = Glib::convert_with_fallback(src, "UTF8", "LATIN1","?"); - } -#else - { - std::auto_ptr error; - utf8_str = locale_to_utf8(src, error); - if (error.get()) - utf8_str = Glib::convert_with_fallback(src, "UTF8", "LATIN1","?", error); - } -#endif //GLIBMM_EXCEPTIONS_ENABLED - return utf8_str; -} - const std::vector ImageData::getIPTCData () const { std::vector iptcc; diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 93e2eebed..b54d30d35 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -409,7 +410,7 @@ int ImageIO::loadTIFF (Glib::ustring fname) { int ImageIO::savePNG (Glib::ustring fname, int compression, int bps) { - FILE* file=g_fopen(fname.c_str (),"wb"); + FILE* file=g_fopen(safe_locale_from_utf8(fname).c_str (),"wb"); if (!file) return IMIO_CANNOTREADFILE; @@ -493,7 +494,7 @@ int ImageIO::saveJPEG (Glib::ustring fname, int quality) { cinfo.err = jpeg_std_error (&jerr); jpeg_create_compress (&cinfo); - FILE *file = g_fopen (fname.c_str (), "wb"); + FILE *file = g_fopen (safe_locale_from_utf8(fname).c_str (), "wb"); if (!file) return IMIO_CANNOTREADFILE; @@ -597,7 +598,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) { unsigned char* linebuffer = new unsigned char[lineWidth]; // TODO the following needs to be looked into - do we really need two ways to write a Tiff file ? if (exifRoot && uncompressed) { - FILE *file = g_fopen (fname.c_str (), "wb"); + FILE *file = g_fopen (safe_locale_from_utf8(fname).c_str (), "wb"); if (!file) return IMIO_CANNOTREADFILE; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8805718b4..0b0b4d68a 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include +#include #include #include #include @@ -329,7 +330,7 @@ int ProcParams::save (Glib::ustring fname) const { keyFile.set_string_list ("IPTC", iptc[i].field, values); } - FILE *f = g_fopen (fname.c_str(), "wt"); + FILE *f = g_fopen (safe_locale_from_utf8(fname).c_str(), "wt"); if (f==NULL) return 1; diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index c2999933c..10571944d 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -208,6 +208,9 @@ rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) { // the same output filename with different extension //processing->params.save (removeExtension(fname) + paramFileExtension); processing->params.save (fname + paramFileExtension); + else { + printf("Unable to process or save %s\n", fname.c_str()); + } if (processing->thumbnail) { processing->thumbnail->imageDeveloped (); processing->thumbnail->imageRemovedFromQueue (); diff --git a/rtgui/safegtk.cc b/rtgui/safegtk.cc index acd0e7dad..5660ae799 100644 --- a/rtgui/safegtk.cc +++ b/rtgui/safegtk.cc @@ -117,6 +117,49 @@ void safe_build_subdir_list (Glib::RefPtr &dir, std::vector error; + utf8_str = locale_to_utf8(src, error); + if (error.get()) + utf8_str = Glib::convert_with_fallback(src, "UTF8", "LATIN1","?", error); + } +#endif //GLIBMM_EXCEPTIONS_ENABLED + return utf8_str; +} + +std::string safe_locale_from_utf8 (const Glib::ustring& utf8_str) +{ + std::string str; +#ifdef GLIBMM_EXCEPTIONS_ENABLED + try { + str = Glib::locale_from_utf8(utf8_str); + } + catch (const Glib::ConvertError& e) { + //str = Glib::convert_with_fallback(utf8_str, "LATIN1", "UTF8", "?"); + } +#else + { + std::auto_ptr error; + str = Glib::locale_from_utf8(utf8_str, error); + /*if (error.get()) + {str = Glib::convert_with_fallback(utf8_str, "LATIN1", "UTF8", "?", error);}*/ + } +#endif //GLIBMM_EXCEPTIONS_ENABLED + return str; +} + + bool safe_spawn_command_line_async (const Glib::ustring& cmd_utf8) { std::string cmd; @@ -144,24 +187,3 @@ bool safe_spawn_command_line_async (const Glib::ustring& cmd_utf8) #endif return success; } - -std::string safe_locale_from_utf8 (const Glib::ustring& utf8_str) -{ - std::string str; -#ifdef GLIBMM_EXCEPTIONS_ENABLED - try { - str = Glib::locale_from_utf8(utf8_str); - } - catch (const Glib::ConvertError& e) { - //utf8_str = Glib::convert_with_fallback(src, "UTF8", "LATIN1","?"); - } -#else - { - std::auto_ptr error; - str = Glib::locale_from_utf8(utf8_str, error); - if (error.get()) - {/*utf8_str = Glib::convert_with_fallback(src, "UTF8", "LATIN1","?", error);*/} - } -#endif //GLIBMM_EXCEPTIONS_ENABLED - return str; -}