From 11ad1dace8458a4373f74f3e37d98f2b8e56e255 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 25 Dec 2017 01:32:29 +0100 Subject: [PATCH 01/13] cmake switch -WITH_BENCHMARK enables BENCHFUN macro for rtengine --- CMakeLists.txt | 1 + rtengine/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3e2f2c4b..fa153855b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,6 +112,7 @@ endif() option(USE_EXPERIMENTAL_LANG_VERSIONS "Build with -std=c++0x" OFF) option(BUILD_SHARED "Build with shared libraries" OFF) +option(WITH_BENCHMARK "Build with benchmark code" OFF) option(WITH_MYFILE_MMAP "Build using memory mapped file" ON) option(WITH_LTO "Build with link-time optimizations" OFF) option(WITH_SAN "Build with run-time sanitizer" OFF) diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 3e5eb15e4..0ed91f23f 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -122,6 +122,9 @@ if(LENSFUN_HAS_LOAD_DIRECTORY) set_source_files_properties(rtlensfun.cc PROPERTIES COMPILE_DEFINITIONS RT_LENSFUN_HAS_LOAD_DIRECTORY) endif() +if(WITH_BENCHMARK) + add_definitions(-DBENCHMARK) +endif() if(NOT WITH_SYSTEM_KLT) set(RTENGINESOURCEFILES ${RTENGINESOURCEFILES} From 3ccfb9b2031111ee72666b81c3579069c17e0949 Mon Sep 17 00:00:00 2001 From: gatoatigrado Date: Mon, 25 Dec 2017 00:41:43 -0500 Subject: [PATCH 02/13] Use AlignedBuffer helper class in rgbProc, use SSE in standard tone curve application. --- rtengine/alignedbuffer.h | 4 +++ rtengine/curves.h | 53 ++++++++++++++++++++++++++++++++++++++++ rtengine/improcfun.cc | 30 ++++++++++------------- 3 files changed, 70 insertions(+), 17 deletions(-) diff --git a/rtengine/alignedbuffer.h b/rtengine/alignedbuffer.h index dd9d7b278..560f0884f 100644 --- a/rtengine/alignedbuffer.h +++ b/rtengine/alignedbuffer.h @@ -21,6 +21,10 @@ #include #include +inline size_t padToAlignment(size_t size, size_t align = 16) { + return align * ((size + align - 1) / align); +} + // Aligned buffer that should be faster template class AlignedBuffer { diff --git a/rtengine/curves.h b/rtengine/curves.h index c616c94da..e443d430c 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -800,6 +800,13 @@ class StandardToneCurve : public ToneCurve { public: void Apply(float& r, float& g, float& b) const; + + // Applies the tone curve to `r`, `g`, `b` arrays, starting at `r[start]` + // and ending at `r[end]` (and respectively for `b` and `g`). Uses SSE + // and requires that `r`, `g`, and `b` pointers have the same alignment. + void BatchApply( + const size_t start, const size_t end, + float *r, float *g, float *b) const; }; class AdobeToneCurve : public ToneCurve @@ -874,6 +881,52 @@ inline void StandardToneCurve::Apply (float& r, float& g, float& b) const g = lutToneCurve[g]; b = lutToneCurve[b]; } +inline void StandardToneCurve::BatchApply( + const size_t start, const size_t end, + float *r, float *g, float *b) const { + assert (lutToneCurve); + + // All pointers must have the same alignment for SSE usage. In the loop body below, + // we will only check `r`, assuming that the same result would hold for `g` and `b`. + assert (reinterpret_cast(r) % 16 == reinterpret_cast(g) % 16); + assert (reinterpret_cast(g) % 16 == reinterpret_cast(b) % 16); + + size_t i = start; + while (true) { + if (i >= end) { + // If we get to the end before getting to an aligned address, just return. + // (Or, for non-SSE mode, if we get to the end.) + return; +#if defined( __SSE2__ ) && defined( __x86_64__ ) + } else if (reinterpret_cast(&r[i]) % 16 == 0) { + // Otherwise, we get to the first aligned address; go to the SSE part. + break; +#endif + } + r[i] = lutToneCurve[r[i]]; + g[i] = lutToneCurve[g[i]]; + b[i] = lutToneCurve[b[i]]; + i++; + } + +#if defined( __SSE2__ ) && defined( __x86_64__ ) + for (; i + 3 < end; i += 4) { + __m128i r_val = _mm_cvtps_epi32(LVF(r[i])); + __m128i g_val = _mm_cvtps_epi32(LVF(g[i])); + __m128i b_val = _mm_cvtps_epi32(LVF(b[i])); + STVF(r[i], lutToneCurve[r_val]); + STVF(g[i], lutToneCurve[g_val]); + STVF(b[i], lutToneCurve[b_val]); + } + + // Remainder in non-SSE. + for (; i < end; ++i) { + r[i] = lutToneCurve[r[i]]; + g[i] = lutToneCurve[g[i]]; + b[i] = lutToneCurve[b[i]]; + } +#endif +} // Tone curve according to Adobe's reference implementation // values in 0xffff space diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 1d38f6be1..082799e62 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -23,6 +23,7 @@ #include #endif +#include "alignedbuffer.h" #include "rtengine.h" #include "improcfun.h" #include "curves.h" @@ -3409,31 +3410,28 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer #pragma omp parallel if (multiThread) #endif { - char *buffer; + size_t perChannelSizeBytes = padToAlignment(sizeof (float) * TS * TS + 4 * 64); + AlignedBuffer buffer(3 * perChannelSizeBytes); char *editIFloatBuffer = nullptr; char *editWhateverBuffer = nullptr; - buffer = (char *) malloc (3 * sizeof (float) * TS * TS + 20 * 64 + 63); - char *data; - data = (char*) ( ( uintptr_t (buffer) + uintptr_t (63)) / 64 * 64); - - float *rtemp = (float (*))data; - float *gtemp = (float (*)) ((char*)rtemp + sizeof (float) * TS * TS + 4 * 64); - float *btemp = (float (*)) ((char*)gtemp + sizeof (float) * TS * TS + 8 * 64); + float *rtemp = buffer.data; + float *gtemp = &rtemp[perChannelSizeBytes / sizeof(float)]; + float *btemp = >emp[perChannelSizeBytes / sizeof(float)]; int istart; int jstart; int tW; int tH; // zero out the buffers - memset(buffer, 0, 3 * sizeof (float) * TS * TS + 20 * 64 + 63); + memset(rtemp, 0, 3 * perChannelSizeBytes); // Allocating buffer for the PipetteBuffer float *editIFloatTmpR = nullptr, *editIFloatTmpG = nullptr, *editIFloatTmpB = nullptr, *editWhateverTmp = nullptr; if (editImgFloat) { editIFloatBuffer = (char *) malloc (3 * sizeof (float) * TS * TS + 20 * 64 + 63); - data = (char*) ( ( uintptr_t (editIFloatBuffer) + uintptr_t (63)) / 64 * 64); + char *data = (char*) ( ( uintptr_t (editIFloatBuffer) + uintptr_t (63)) / 64 * 64); editIFloatTmpR = (float (*))data; editIFloatTmpG = (float (*)) ((char*)editIFloatTmpR + sizeof (float) * TS * TS + 4 * 64); @@ -3442,7 +3440,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (editWhatever) { editWhateverBuffer = (char *) malloc (sizeof (float) * TS * TS + 20 * 64 + 63); - data = (char*) ( ( uintptr_t (editWhateverBuffer) + uintptr_t (63)) / 64 * 64); + char *data = (char*) ( ( uintptr_t (editWhateverBuffer) + uintptr_t (63)) / 64 * 64); editWhateverTmp = (float (*))data; } @@ -3618,10 +3616,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (hasToneCurve1) { if (curveMode == ToneCurveParams::TcMode::STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { - for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const StandardToneCurve& userToneCurve = static_cast (customToneCurve1); - userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); - } + const StandardToneCurve& userToneCurve = static_cast (customToneCurve1); + userToneCurve.BatchApply ( + 0, tW - jstart, + &rtemp[ti * TS], >emp[ti * TS], &btemp[ti * TS]); } } else if (curveMode == ToneCurveParams::TcMode::FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -4529,8 +4527,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } } - free (buffer); - if (editIFloatBuffer) { free (editIFloatBuffer); } From ebc92e1c350b028ae16a113051b8c3e46d4da0f1 Mon Sep 17 00:00:00 2001 From: gatoatigrado Date: Mon, 25 Dec 2017 14:55:14 -0500 Subject: [PATCH 03/13] New SSE interpolating routine for LUT. --- rtengine/LUT.h | 94 +++++++++++++++++------------------------------ rtengine/curves.h | 7 ++-- 2 files changed, 38 insertions(+), 63 deletions(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 2701c4ffc..4f245634e 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -95,6 +95,8 @@ protected: // list of variables ordered to improve cache speed unsigned int maxs; float maxsf; + // possibly-more-correct value for sse routine (see unit test for details) + float maxIndexFloat; T * data; unsigned int clip; unsigned int size; @@ -129,6 +131,7 @@ public: upperBound = size - 1; maxs = size - 2; maxsf = (float)maxs; + maxIndexFloat = ((float)upperBound) - 1e-5; #if defined( __SSE2__ ) && defined( __x86_64__ ) maxsv = F2V( maxs ); sizeiv = _mm_set1_epi32( (int)(size - 1) ); @@ -158,6 +161,7 @@ public: upperBound = size - 1; maxs = size - 2; maxsf = (float)maxs; + maxIndexFloat = ((float)upperBound) - 1e-5; #if defined( __SSE2__ ) && defined( __x86_64__ ) maxsv = F2V( maxs ); sizeiv = _mm_set1_epi32( (int)(size - 1) ); @@ -228,6 +232,7 @@ public: this->upperBound = rhs.upperBound; this->maxs = this->size - 2; this->maxsf = (float)this->maxs; + this->maxIndexFloat = ((float)this->upperBound) - 1e-5; #if defined( __SSE2__ ) && defined( __x86_64__ ) this->maxsv = F2V( this->size - 2); this->sizeiv = _mm_set1_epi32( (int)(this->size - 1) ); @@ -293,72 +298,37 @@ public: } #if defined( __SSE2__ ) && defined( __x86_64__ ) -/* - vfloat operator[](vfloat indexv ) const + vfloat operator[](vfloat indexv) const { -// printf("don't use this operator. It's not ready for production"); - return _mm_setzero_ps(); + static_assert(std::is_same::value, "This method only works for float LUTs"); - // convert floats to ints - vint idxv = _mm_cvttps_epi32( indexv ); - vfloat tempv, resultv, p1v, p2v; - vmask maxmask = vmaskf_gt(indexv, maxsv); - idxv = _mm_castps_si128(vself(maxmask, maxsv, _mm_castsi128_ps(idxv))); - vmask minmask = vmaskf_lt(indexv, _mm_setzero_ps()); - idxv = _mm_castps_si128(vself(minmask, _mm_setzero_ps(), _mm_castsi128_ps(idxv))); - // access the LUT 4 times and shuffle the values into p1v and p2v + // Clamp and convert to integer values. Extract out of SSE register because all + // lookup operations use regular addresses. + vfloat clampedIndexes = _mm_max_ps( + _mm_setzero_ps(), + _mm_min_ps(_mm_set1_ps(maxIndexFloat), indexv)); + vint indexes = _mm_cvttps_epi32(clampedIndexes); + int indexArray[4]; + _mm_storeu_si128(reinterpret_cast<__m128i*>(&indexArray[0]), indexes); - int idx; + // Load data from the table. This reads more than necessary, but there don't seem + // to exist more granular operations (though we could try non-SSE). + // Cast to int for convenience in the next operation (partial transpose). + vint values[4]; + for (int i = 0; i < 4; ++i) { + values[i] = _mm_castps_si128(LVFU(data[indexArray[i]])); + } - // get 4th value - idx = _mm_cvtsi128_si32 (_mm_shuffle_epi32(idxv, _MM_SHUFFLE(3, 3, 3, 3))); - tempv = LVFU(data[idx]); - p1v = _mm_shuffle_ps(tempv, tempv, _MM_SHUFFLE(0, 0, 0, 0)); - p2v = _mm_shuffle_ps(tempv, tempv, _MM_SHUFFLE(1, 1, 1, 1)); - // now p1v is 3 3 3 3 - // p2v is 3 3 3 3 + // Partial 4x4 transpose operation. We want two new vectors, the first consisting + // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. + __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); + __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); + vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); - // get 3rd value - idx = _mm_cvtsi128_si32 (_mm_shuffle_epi32(idxv, _MM_SHUFFLE(2, 2, 2, 2))); - tempv = LVFU(data[idx]); - p1v = _mm_move_ss( p1v, tempv); - tempv = _mm_shuffle_ps(tempv, tempv, _MM_SHUFFLE(1, 1, 1, 1)); - p2v = _mm_move_ss( p2v, tempv); - // now p1v is 3 3 3 2 - // p2v is 3 3 3 2 - - // get 2nd value - idx = _mm_cvtsi128_si32 (_mm_shuffle_epi32(idxv, _MM_SHUFFLE(1, 1, 1, 1))); - tempv = LVFU(data[idx]); - p1v = _mm_shuffle_ps( p1v, p1v, _MM_SHUFFLE(1, 0, 1, 0)); - p2v = _mm_shuffle_ps( p2v, p2v, _MM_SHUFFLE(1, 0, 1, 0)); - // now p1v is 3 2 3 2 - // now p2v is 3 2 3 2 - p1v = _mm_move_ss( p1v, tempv ); - // now p1v is 3 2 3 1 - tempv = _mm_shuffle_ps(tempv, tempv, _MM_SHUFFLE(1, 1, 1, 1)); - p2v = _mm_move_ss( p2v, tempv); - // now p1v is 3 2 3 1 - - // get 1st value - idx = _mm_cvtsi128_si32 (_mm_shuffle_epi32(idxv, _MM_SHUFFLE(0, 0, 0, 0))); - tempv = LVFU(data[idx]); - p1v = _mm_shuffle_ps( p1v, p1v, _MM_SHUFFLE(3, 2, 0, 0)); - // now p1v is 3 2 1 1 - p2v = _mm_shuffle_ps( p2v, p2v, _MM_SHUFFLE(3, 2, 0, 0)); - // now p2v is 3 2 1 1 - p1v = _mm_move_ss( p1v, tempv ); - // now p1v is 3 2 1 0 - tempv = _mm_shuffle_ps(tempv, tempv, _MM_SHUFFLE(1, 1, 1, 1)); - p2v = _mm_move_ss( p2v, tempv); - // now p2v is 3 2 1 0 - - vfloat diffv = indexv - _mm_cvtepi32_ps ( idxv ); - diffv = vself(vorm(maxmask, minmask), _mm_setzero_ps(), diffv); - resultv = p1v + p2v * diffv; - return resultv ; + vfloat diff = clampedIndexes - _mm_cvtepi32_ps(indexes); + return (_mm_set1_ps(1.0f) - diff) * lower + (diff * upper); } -*/ #ifdef __SSE4_1__ template::value>::type> vfloat operator[](vint idxv ) const @@ -456,6 +426,8 @@ public: } idx = 0; + // Note: Maybe this should be 'idx > maxsf'? See unit test where a LUT with + // values [10, 11, 12, 13] gets looked up at 2.5 and returns 12.5. } else if (index > maxsf) { if (clip & LUT_CLIP_ABOVE) { return data[upperBound]; @@ -543,6 +515,7 @@ public: maxs = 0; maxsf = 0.f; clip = 0; + maxIndexFloat = ((float)upperBound) - 1e-5; } // create an identity LUT (LUT(x) = x) or a scaled identity LUT (LUT(x) = x / divisor) @@ -652,6 +625,7 @@ public: upperBound = size - 1; maxs = size - 2; maxsf = (float)maxs; + maxIndexFloat = ((float)upperBound) - 1e-5; #if defined( __SSE2__ ) && defined( __x86_64__ ) maxsv = F2V( size - 2); sizeiv = _mm_set1_epi32( (int)(size - 1) ); diff --git a/rtengine/curves.h b/rtengine/curves.h index e443d430c..15ab96624 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -881,6 +881,7 @@ inline void StandardToneCurve::Apply (float& r, float& g, float& b) const g = lutToneCurve[g]; b = lutToneCurve[b]; } + inline void StandardToneCurve::BatchApply( const size_t start, const size_t end, float *r, float *g, float *b) const { @@ -911,9 +912,9 @@ inline void StandardToneCurve::BatchApply( #if defined( __SSE2__ ) && defined( __x86_64__ ) for (; i + 3 < end; i += 4) { - __m128i r_val = _mm_cvtps_epi32(LVF(r[i])); - __m128i g_val = _mm_cvtps_epi32(LVF(g[i])); - __m128i b_val = _mm_cvtps_epi32(LVF(b[i])); + __m128 r_val = LVF(r[i]); + __m128 g_val = LVF(g[i]); + __m128 b_val = LVF(b[i]); STVF(r[i], lutToneCurve[r_val]); STVF(g[i], lutToneCurve[g_val]); STVF(b[i], lutToneCurve[b_val]); From 8f7cd6bf8f04e79eac74035e3bc567bc30058250 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 25 Dec 2017 22:49:53 +0100 Subject: [PATCH 04/13] Removed unmaintained buildRT Bash script --- tools/buildRT | 450 -------------------------------------------------- 1 file changed, 450 deletions(-) delete mode 100755 tools/buildRT diff --git a/tools/buildRT b/tools/buildRT deleted file mode 100755 index 71370e8df..000000000 --- a/tools/buildRT +++ /dev/null @@ -1,450 +0,0 @@ -#!/usr/bin/env bash -# Written by DrSlony -# buildRT version 4.4, 2016-03-03 -# Please report bugs or enhancements to https://github.com/Beep6581/RawTherapee/issues -# www.rawtherapee.com -# www.londonlight.org - -head -n 4 $0 | tail -n 2 | sed $'1s/.\+/\E[1m&\E[0m/' -echo - -if [[ $UID -eq 0 ]]; then - printf "%s\n" "Do not run this script as root!" "Aborting" - exit 1 -fi - -alert () { - case "$alert_type" in - notify-send) notify-send "RawTherapee" "$1" ;; - kdialog) kdialog --title "RawTherapee" --passivepopup "$(printf "%b\n" "$1")" ;; - zenity) zenity --notification --text="$(printf "%b\n" "$1")" ;; - xmessage) xmessage -nearmouse "$(printf "%b\n" "$1")" ;; - none) printf "%b\n" "" "Compilation complete:" "$1" ;; -esac -} - -#--- Set some variables -unset choiceNumber choiceNumbers buildType buildTypes list branch branches repo -version="4.3" -movetoPatched="" -repo="${HOME}/rawtherapee" -procTarget=2 - -while getopts "bc:fnp:s:t:uvh?-" opt; do - case "${opt}" in - b) patched="yes" - movetoPatched="_patched" - printf "%s\n" "Buildonly flag detected, will not git pull or checkout" ;; - c) dCacheNameSuffix="$OPTARG" - dCacheNameSuffix=${dCacheNameSuffix//[^\.\-_a-zA-Z0-9]/}; - forceCmake="yes" - printf "%s\n" "Cache and config name suffix: $dCacheNameSuffix" ;; - f) forceCmake="yes" - printf "%s\n" "Will forcefully re-run CMake" ;; - n) noomp="-DOPTION_OMP=OFF" - forceCmake="yes" - printf "%s\n" "OpenMP disabled" ;; - p) procTarget="$OPTARG" - if [[ $procTarget -lt 1 || $procTarget -gt 9 ]]; then - printf "%s\n" "Invalid processor target value." "Use a value from 1 to 9, e.g." "./buildRT -p 1" "See ProcessorTargets.cmake" "Aborting" - exit 1 - forceCmake="yes" - fi ;; - s) movetoPatched="_${OPTARG//[^\.\-_a-zA-Z0-9]/}" - printf "%s\n" "Suffix of destination build dir: ${movetoPatched}" ;; - t) titleSuffix="${OPTARG//[^\.\-\:\ \+_a-zA-Z0-9]/}" - forceCmake="yes" - printf "%s\n" "Titlebar version suffix: ${titleSuffix}" ;; - u) gcVer="$(curl "https://raw.githubusercontent.com/Beep6581/RawTherapee/master/tools/buildRT" 2>/dev/null | grep "^#.*[vV]ersion.*")" || { echo "\"curl\" program not found, please install it first."; exit 1; } - gcVer="${gcVer##*[[:alpha:]] }" - gcVer="${gcVer%%,*}" - latestVer="$(printf "%s\n" "$version" "$gcVer" | sort -rV | head -n 1)" - if [[ $version = $latestVer ]]; then - printf "%s\n" "You are using the latest version of buildRT, $version" - exit 0 - else - printf "%s\n" "You are using version $version but version $gcVer is available on GitHub." "You can download the GitHub version from this URL:" " https://raw.githubusercontent.com/Beep6581/RawTherapee/master/tools/buildRT" "Replace it with this script, and remember to run \"chmod +x buildRT\"" - exit 0 - fi ;; - v) verbose=yes - printf "%s\n" "Verbose mode, I will spam your screen with warnings" ;; - h|\?|-) printf "%s\n" "Usage:" "" " $0 [-b] [-c ] [-f] [-n] [-p <1-9>] [-s ] [-t \"\"] [-v]" "" - printf "%s\n" \ - " -b" \ - "Build-only mode. buildRT uses \"git checkout master\" to update your source code repository to the newest revision, however doing so might destroy any uncommitted or unpushed changes you made or any patches you applied. With the -b flag the script will not update the source code, so that you can easily compile RawTherapee with whatever patches you manually applied. buildRT should automatically detect if you modified the source code, but you can use this flag to force build-only mode." "Generally when compiling patched RT versions you want to keep the cache and config folders separate, so consider using \"-b -c _testing\"" "" \ - " -c " \ - "Specify a suffix to the cache and config directory names. Only alphanumerics, periods, dashes and underscores are valid. The default value is \"4\", which will result in your build of RawTherapee storing the cache in \"${HOME}/.cache/RawTherapee4\" and config in \"${HOME}/.config/RawTherapee4\". For example, use \"-c _testing\" if you want to test older or patched versions of RawTherapee without potentially damaging your \"real\" cache and config files." "" \ - " -f" \ - "Force CMake to re-run." "" \ - " -n" \ - "Disable OpenMP." "" \ - " -p <1-9>" \ - "Set which processor target to use. Takes a single digit from 1 to 9. The default is 2. See ProcessorTargets.cmake" "" \ - " -s " \ - "Suffix of destination build directory, so that if you have applied a patch, say \"dustremoval-1.patch\", and want to have RawTherapee compiled to a folder whose name ends with \"_dustremoval1\", you would set \"-s dustremoval1\" (the underscore is automated)." "" \ - " -t \"\"" \ - "Suffix displayed next to the RawTherapee version in the window titlebar. It is recommended that you include the commit of the newest public commit (the one you would see if you cloned the repository anew) so it is clear which commit you applied the patches to. E.g.:" "-t \": ee72ddbcfd4e + dustremoval-1.patch + mustafa ibrahim\"" "" \ - " -u" \ - "Check for an update of buildRT on GitHub." "" \ - " -v" \ - "Make compilation verbose, so you see all compiler warnings." | fold -s - exit 0 ;; -esac -done -shift $((OPTIND-1)) -[ "$1" = "--" ] && shift - -printf "%s\n" "Repository: ${repo}" -printf "%s\n" "Processor target: ${procTarget}" - -if [[ -z $verbose ]]; then - Wcflags="-Wno-unused-result -Wno-aggressive-loop-optimizations" -fi - -cpuCount="$(grep -c 'processor' /proc/cpuinfo)" -# We can assume that if grep returns more than 32 lines (CPUs), or nothing at all, something's wrong -if (( cpuCount < 1 || cpuCount > 32 )); then - cpuCount="1" -fi -printf "%s\n" "CPU count: ${cpuCount}" - -# Zenity --notification is broken in <=3.8.0, removed Zenity support for now. -# elif hash zenity 2>/dev/null; then alert_type="zenity" -if hash notify-send 2>/dev/null; then alert_type="notify-send" -elif hash kdialog 2>/dev/null; then alert_type="kdialog" -elif hash xmessage 2>/dev/null; then alert_type="xmessage" -else alert_type="none" -fi - -# list from http://linuxmafia.com/faq/Admin/release-files.html -distributions=( -"Annvix /etc/annvix-release" -"Arch /etc/arch-release" -"Arklinux /etc/arklinux-release" -"Aurox /etc/aurox-release" -"BlackCat /etc/blackcat-release" -"Cobalt /etc/cobalt-release" -"Conectiva /etc/conectiva-release" -"Debian /etc/debian_version" -"Fedora /etc/fedora-release" -"Gentoo /etc/gentoo-release" -"Immunix /etc/immunix-release" -"Knoppix knoppix_version" -"Linux-From-Scratch /etc/lfs-release" -"Linux-PPC /etc/linuxppc-release" -"Mandrake /etc/mandrake-release" -"Mandriva_Mandrake /etc/mandriva-release /etc/mandrake-release /etc/mandrakelinux-release" -"Mint /etc/linuxmint/info" -"MkLinux /etc/mklinux-release" -"Novell /etc/nld-release" -"PLD /etc/pld-release" -"RedHat /etc/redhat-release" -"CentOS /etc/centos-release" -"Slackware /etc/slackware-version" -"SME /etc/e-smith-release" -"Solaris /etc/release" -"SunJDS /etc/sun-release" -"SUSE /etc/SuSE-release" -"TinySofa /etc/tinysofa-release" -"TurboLinux /etc/turbolinux-release" -"Ubuntu /etc/lsb-release" -"UltraPenguin /etc/ultrapenguin-release" -"United /etc/UnitedLinux-release" -"VA-Linux /etc/va-release" -"YellowDog /etc/yellowdog-release" -) -for element in "${distributions[@]}"; do - read distro loc1 loc2 loc3 <<< "$element" - for loc in $loc1 $loc2 $loc3 - do - # distribution=${distro} because if none of the elements match, distro will =YellowDog (last item in the list) - # add "break 2;" to the end if we really want to, but Ubuntu gets detected as Debian first, then as Ubuntu, - # so we might want to not break the loop. - [[ -e "$loc" ]] && distribution=${distro} - [[ "$distribution" = Gentoo ]] && break 2 - done -done -if [[ -z ${distribution} ]]; then - printf "%s\n" "" "Could not automatically detect your distribution. Please enter your distribution's name below followed immediately by the version, without any spaces or punctuation marks, and hit enter to confirm, e.g. \"Ubuntu1310\", \"Mint15\" or \"OpenSUSE123\"" | fold -s - read distribution - #sanitize - distribution=${distribution//[^a-zA-Z0-9]/} -fi -printf "%s\n" "Distribution: ${distribution}"; - -bits="$(uname -m)" || { printf "%s\n" "Is your system a 32-bit or 64-bit one?" "Enter 32 or 64 and hit enter: "; read bits; bits=${bits//[^0-9]/}; } -if [[ $bits = *64* ]]; then - bits=64 -else - bits=32 -fi -printf "%s\n" "System: ${bits}-bit" "" - -#--- Check script dependencies -hash git 2>/dev/null || { echo >&2 "Git not found, install Git first and then re-run this script."; exit 1; } - -#--- Clone and/or pull -if [[ ! -d "${repo}" ]]; then - printf "%s\n" "${repo} not found, cloning from GitHub..." - git clone https://github.com/Beep6581/RawTherapee.git "${repo}" - cd "${repo}" || exit 1 - verLatesttag="$(git describe --tags --abbrev=0)" - verLatesttagdistance="$(git describe --tags | sed -e 's/.*-\([0-9]\+\)-.*/\1/')" - currentBranch="$(git branch | grep "*" | sed -e 's/.* \+//')" - rev="$(git rev-list --all --count)" - node="$(git rev-parse --short HEAD)" - printf "\nRepository state:\n Branch: ${currentBranch}\n RawTherapee-${verLatesttag}.${verLatesttagdistance}\n Commit: ${rev}:${node}\n Latest tag: ${verLatesttag}\n\n" - alert "Repository cloned succesfully. What would you like to do next?" - printf "%b" "Repository cloned succesfully.\n" "Press 'q' to quit or any other key to continue... " - read -r -n 1 - echo - [[ $REPLY = q || $REPLY = Q ]] && { printf "%s\n" "Quitting." ""; exit 0; } -fi -cd "${repo}" || exit 1 - -#--- Update or decide what to do if user edited the source code (e.g. by applying a patch) -if [[ -z $patched ]]; then - uncommitted="$(git status -s | sed "s/^/\t/")" - unpushed="$(git log origin..HEAD | sed "s/^/\t/" || echo "Could not check for unpushed changes (check your internet connection), but continuing anyway.")" -fi -if [[ -z $uncommitted && -z $unpushed && -z $patched ]]; then - git pull || echo "Could not \"git pull\" (check your internet connection), but continuing anyway." - git checkout master - echo -elif [[ -z $patched ]]; then - printf "%s\n" "" "Warning! There are uncommitted or unpushed changes in the repository!" "Uncommitted:" "$uncommitted" "Unpushed:" "$unpushed" "" "This means that you edited the source code (e.g. applied a patch). If the script proceeds to update the repository, those changes you made to the source code might be lost. Your choices are to force the update and possibly lose the changes, not to update and to compile RT as-is, or to abort the script." | fold -s - read -r -p "[f]orce update, [c]ompile as-is, or [a]bort? " fca - case $fca in - f|F) git pull || echo "Could not \"git pull\" (check your internet connection), but continuing anyway." - git checkout master - echo ;; - c|C) printf "%s\n" "Retaining edited source code and compiling RT as-is." "" - patched="yes" - if [[ -z $movetoPatched ]]; then - movetoPatched="_patched" - fi ;; - *) printf "%s\n" "User aborted" "" - exit 0 ;; - esac -else - printf "%s\n" "Retaining edited source code and compiling RT as-is." "" - if [[ -z $movetoPatched ]]; then - movetoPatched="_patched" - fi -fi - -cd "${repo}" || exit 1 -verLatesttag="$(git describe --tags --abbrev=0)" -verLatesttagdistance="$(git describe --tags | sed -e 's/.*-\([0-9]\+\)-.*/\1/')" -currentBranch="$(git branch | grep "*" | sed -e 's/.* \+//')" -rev="$(git rev-list --all --count)" -node="$(git rev-parse --short HEAD)" -printf "\nRepository state:\n Branch: ${currentBranch}\n RawTherapee-${verLatesttag}.${verLatesttagdistance}\n Commit: ${rev}:${node}\n Latest tag: ${verLatesttag}\n\n" - -#--- Print the menu -branches=() -if [[ -z $patched ]]; then - while read -r branch; do - branches+=("$branch") - done < <(git branch -a | grep origin | sed -e 's/.*\///'| sort -uf) -else - branches="$(git branch | grep "*" | sed -e 's/.* \+//')" -fi - -# Make the menu list -list=("0" "[abort]" "[exit]") -num="1" -buildTypes=("release" "debug") -for branch in "${branches[@]}"; do - for buildType in "${buildTypes[@]}"; do - list+=("$num" "${branch}" "${buildType}") - ((num++)) - done -done - -printf "%s\n" "---------------------------------------------" -printf "%s\t%s\t%s\n" "#" "Branch" "Build Type" "${list[@]}" | column -t -s $'\t' -c 3 | sed $'1s/.\+/\E[1m&\E[0m/' -printf "%s\n" "---------------------------------------------" "" "Enter your choices, each number separated by a single space, e.g. 3 4" "If you don't know which option to choose, then choose the \"default\" branch, \"release\" build type." "" | fold -s - -# make sure choices are valid -checkChoices () { - choiceNumbers="${choiceNumbers//[^0-9 ]/}" - # all choiceNumbers must exist in listNums, else ask again - for choiceNumber in "${choiceNumbers[@]}"; do - if [[ "${choiceNumber}" = 0 ]]; then - exit 0; - fi - found=0 - # for each num in list[@] - for (( o=3 ; o<${#list[@]} ; ((o+=3)) )); do - if [[ "${list[$o]}" = ${choiceNumber} ]]; then - found=1; - fi - done - # if one of the numbers the user typed arent in the list, break the loop and ask for input again - if [[ $found = 0 ]]; then - [[ -n ${choiceNumbers[@]} ]] && printf '%s\n' "Invalid choices, try again." - return 1; - fi - done -} - -# keep repeating read until choices are valid -until checkChoices; do - read -r -p "Your choices: " -a choiceNumbers -done -printf "%s\n" "" "---------------------------------------------" "" - -#--- Compile the chosen builds -for choiceNumber in "${choiceNumbers[@]}"; do - if [[ $choiceNumber = 0 ]]; then - printf "%s\n" "User exited." - exit 0; - fi - # ${array[@]:offset:length} - # choiceNumber*3 to get the human menu choice to match the correct array index, and then +1 so we offset to branch and buildType, not #. - IFS=$'\t' read -r branch buildType < <(printf "%s\t%s\n" "${list[@]:$(($((choiceNumber*3))+1)):2}") - # extra safety check - if [[ -z "$branch" ]] || [[ -z "$buildType" ]]; then - print '%s\n' "Something went wrong with the selection, \"branch\" or \"buildType\" empty." "Aborting" - exit 1 - fi - # This seems useless "$branch != default" - # if [[ -z $patched && $branch != default ]]; then - if [[ -z $patched ]]; then - printf "%s\n" "Updating to branch $branch" - git checkout "$branch" || exit 1 - fi - echo - printf "%-15b %b\n" "\E[1mWill compile\E[0m:" "" "\tChoice number:" "$choiceNumber" "\tBranch:" "$branch" "\tBuild type:" "$buildType" "\tTarget:" "$procTarget" "" - - [[ -d "${HOME}/rt_${branch}_${buildType}${movetoPatched}" ]] && { - printf "%s\n" "Found old build directory ${HOME}/rt_${branch}_${buildType}${movetoPatched}" "To proceed you must either delete it, or choose a suffix for the destination folder for this build." - read -r -p "[d]elete old build, [r]ename this build destination folder, or [a]bort " - echo - case $REPLY in - d|D) rm -rf "${HOME}/rt_${branch}_${buildType}${movetoPatched}" || exit 1 ;; - r|R) printf "%s\n" "The build will be saved to \"${HOME}/rt_${branch}_${buildType}_X\" where \"X\" will be replaced with whatever suffix you choose next. Only alphanumerics, dashes, underscores and periods are valid." | fold -s - read -r -p "Suffix: " - movetoPatched="_${REPLY//[^\.\-_a-zA-Z0-9]/}" - printf "%s\n" "Build will be compiled to \"${HOME}/rt_${branch}_${buildType}${movetoPatched}\"" ;; - a|A) printf "%s\n" "Cannot proceed if old build directory exists." "Remove it or rename it, then re-run this script." "Aborting" - exit 0 ;; - *) printf "%s\n" "Unknown response \"$REPLY\"" - exit 1 ;; - esac - } - - cd "${repo}" || exit 1 - - [[ -z $dCacheNameSuffix ]] && dCacheNameSuffix="${verLatesttag%%.*}" - - # need to rerun cmake if buildtype changed - if [[ -e build/CMakeCache.txt ]]; then - previousBuildType="$(grep 'CMAKE_BUILD_TYPE:STRING=' build/CMakeCache.txt)" - previousBuildType="${previousBuildType##*=}" - fi - if [[ ! -e build/CMakeCache.txt || $previousBuildType != "$buildType" ]]; then - forceCmake="yes" - fi - - if [[ ! -d "${repo}/build" || $forceCmake = yes ]]; then - # Clean up leftovers from previous successful or failed builds - [[ -d "${repo}/${buildType}" ]] && { printf "%s\n" "Found old build directory \"${repo}/$buildType\". Removing it."; rm -rf "${repo}/${buildType}"; } - [[ -d "${repo}/rawtherapee" ]] && { printf "%s\n" "Found old build directory \"${repo}/rawtherapee\". Removing it."; rm -rf "${repo}/rawtherapee"; } - [[ -d "${repo}/build" ]] && { printf "%s\n" "Found old build directory \"${repo}/build\". Removing it."; rm -rf "${repo}/build"; } - printf "%s\n" "" "Cleaning out old CMake files" - make clean || { printf "%s\n" "Error while running \"make clean\", aborting." "Easiest solution: delete ${repo} and re-run buildRT."; exit 1; } - ./clean.sh || { printf "%s\n" "Error while running \"./clean.sh\", aborting." "Easiest solution: delete ${repo} and re-run buildRT."; exit 1; } - mkdir "${repo}/build" || exit 1 - - # As of changeset 1930:067e362c6f28 on Mon Jun 25 2012, revision number 1930, RT supports and encourages out-of-source builds. - if (( rev < 1930 )); then - cmake \ - -DCMAKE_BUILD_TYPE="$buildType" \ - -DPROC_TARGET_NUMBER="$procTarget" \ - -DCMAKE_C_FLAGS="-pipe" \ - -DCMAKE_CXX_FLAGS="$CMAKE_C_FLAGS $Wcflags" \ - "$noomp" \ - -DCMAKE_INSTALL_PREFIX="build" \ - -DBUILD_BUNDLE="ON" \ - -DBINDIR="." \ - -DDATADIR="." \ - -DCACHE_NAME_SUFFIX="$dCacheNameSuffix" \ - || { echo "Error during cmake, exiting."; exit 1; } - else - cd "${repo}/build" - cmake \ - -DCMAKE_BUILD_TYPE="$buildType" \ - -DPROC_TARGET_NUMBER="$procTarget" \ - -DCMAKE_C_FLAGS="-pipe" \ - -DCMAKE_CXX_FLAGS="$CMAKE_C_FLAGS $Wcflags" \ - "$noomp" \ - -DCMAKE_INSTALL_PREFIX="build" \ - -DBUILD_BUNDLE="ON" \ - -DBINDIR="." \ - -DDATADIR="." \ - -DCACHE_NAME_SUFFIX="$dCacheNameSuffix" \ - -DVERSION_SUFFIX="$titleSuffix" \ - ../ \ - || { echo "Error during cmake, exiting."; exit 1; } - fi - fi - echo - - if (( rev >= 1930 )); then - cd "${repo}/build" || exit 1 - fi - - printf "%s\n" "" "Starting compilation:" - time { make -j${cpuCount} install; } || { printf "%s\n" "" "Error during make, exiting."; exit 1; } - printf "%-15b %b\n" "" "" "RawTherapee compiled:" "" "\tChoice number:" "$choiceNumber" "\tBranch:" "$branch" "\tBuild type:" "$buildType" "\tTarget:" "$procTarget" "\tCache:" "${HOME}/.cache/RawTherapee${dCacheNameSuffix}" "\tConfig:" "${HOME}/.config/RawTherapee${dCacheNameSuffix}" "" "" - - # RT used to build into various places over the years. - # We want to end up with the build in a folder called "/build/rawtherapee" regardless of which old version you compile, and then to zip it, so we move dirs around: - if (( rev < 1930 )); then - if [[ -d "${repo}/${buildType}" ]]; then - printf "%s\n" "Moving \"${repo}/${buildType}\" to \"${repo}/build/rawtherapee\"" - mv "${repo}/${buildType}" "${repo}/build/rawtherapee" - elif [[ -d "${repo}/rawtherapee" ]]; then - printf "%s\n" "Moving \"${repo}/rawtherapee\" to \"${repo}/build/rawtherapee\"" - mv "${repo}/rawtherapee" "${repo}/build/rawtherapee" - elif [[ ! -d "${repo}/build" ]]; then - { printf "%s\n" "Could not find the \"build\" directory containing the compiled RawTherapee in ${repo}" "Please notify DrSlony in the forum:" "http://rawtherapee.com/forum/viewtopic.php?f=10&t=3001#p22213" "" "Exiting"; exit 1; } - fi - elif [[ -d "${repo}/build/${buildType}" ]]; then - printf "%s\n" "Moving \"${repo}/build/${buildType}\" to \"${repo}/build/rawtherapee\"" - mv "${repo}/build/${buildType}" "${repo}/build/rawtherapee" - fi - - echo - cd "${repo}/build" - # ${repo}/build/AboutThisBuild.txt doesn't exist with older versions - # Put "AboutThisBuild.txt" alongside the "rawtherapee" dir for the zip so that the website can extract the needed info when uploading the build (no other reason) - if [[ ! -e AboutThisBuild.txt ]]; then - cp "rawtherapee/AboutThisBuild.txt" AboutThisBuild.txt || { printf "%s\n" "Could not copy ${repo}/build/rawtherapee/AboutThisBuild.txt to ${repo}/build/AboutThisBuild.txt, exiting."; exit 1; } - fi - - cat AboutThisBuild.txt || { printf "%s\n" "${repo}/build/AboutThisBuild.txt not found, exiting."; exit 1; } - - if [[ -z $patched ]]; then - printf "%s\n" "Zipping the compiled RawTherapee dir \"${repo}/build/rawtherapee\" and putting it in \"/tmp/RawTherapee_${branch}_${distribution}_${bits}_${verLatesttag}.${verLatesttagdistance}_${buildType}.zip\"" - [[ -e "/tmp/RawTherapee_${branch}_${distribution}_${bits}_${verLatesttag}.${verLatesttagdistance}_${buildType}.zip" ]] && { rm "/tmp/RawTherapee_${branch}_${distribution}_${bits}_${verLatesttag}.${verLatesttagdistance}_${buildType}.zip" || exit 1; } - zip -Xrq "/tmp/RawTherapee_${branch}_${distribution}_${bits}_${verLatesttag}.${verLatesttagdistance}_${buildType}.zip" AboutThisBuild.txt rawtherapee - fi - - # Now that the zip is ready, the build can be moved to ~/rt__<_patched> - printf "%s\n" "" "Moving \"${repo}/build/rawtherapee\" to \"${HOME}/rt_${branch}_${buildType}${movetoPatched}\"" - mv "${repo}/build/rawtherapee" "${HOME}/rt_${branch}_${buildType}${movetoPatched}" || { printf "%s\n" "" "Could not move \"${repo}/build/rawtherapee\" to \"${HOME}/rt_${branch}_${buildType}${movetoPatched}\", exiting."; exit 1; } - - printf "%-15b %b\n" "" "" "Build ready:" "" "\tChoice number:" "$choiceNumber" "\tBranch:" "$branch" "\tBuild type:" "$buildType" "\tTarget:" "$procTarget" - printf "%b\n" "" "\E[1mTo run RawTherapee\E[0m, fire up a terminal and type:" "~/rt_${branch}_${buildType}${movetoPatched}/rawtherapee" "" "------------------------------------------" - alert "RawTherapee-${verLatesttag}.${verLatesttagdistance} ready.\nChoice number ${choiceNumber}, branch: ${branch}, type: ${buildType}, target: ${procTarget}" -done - -# builds=( /tmp/RawTherapee* ); for f in ${builds[@]}; do echo ${f#/tmp/}; done -if [[ -z $patched ]]; then - printf "%s\n" "RawTherapee zipped builds ready in /tmp" - ls -lh /tmp/RawTherapee* -fi -printf "%s\n" "" "Finished building all chosen versions of RawTherapee" From 81d9db35aa682d415aa3d1258f1f422ff08199e7 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 25 Dec 2017 22:50:22 +0100 Subject: [PATCH 05/13] Added new tools/build-rawtherapee Bash script --- tools/build-rawtherapee | 132 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100755 tools/build-rawtherapee diff --git a/tools/build-rawtherapee b/tools/build-rawtherapee new file mode 100755 index 000000000..8c86ed54d --- /dev/null +++ b/tools/build-rawtherapee @@ -0,0 +1,132 @@ +#!/usr/bin/env bash +# By Morgan Hardwood +# Version 2017-12-25 +# This script gets the latest source code for the given program and compiles it. + +# The name of the program, used for the folder names: +prog="rawtherapee" + +# The name of the compiled executable: +exe="${prog}" + +# The name of the sub-folder, if any, relative to the folder into which the +# compiled executable is placed. +# e.g. If the executable ends up in: +# ~/programs/someProgram/foo/bar/someExecutable +# then set it to: +# exeRelativePath="foo/bar" +# or if the executable ends up in +# ~/programs/someProgram/someExecutable +# then leave it empty: +# exeRelativePath="" +exeRelativePath="" + +# The path to the repository: +repo="git@github.com:Beep6581/RawTherapee.git" + +# No touching below this line, with the exception of the "Compile" section +# ----------------------------------------------------------------------------- + +buildOnly="false" +buildType="release" + +# Removes the trailing forward-slash if one is present +exeRelativePath="${exeRelativePath/%\/}" +# Append forward-slash to exeRelativePath only if it is not empty. +exePath="${exeRelativePath:+${exeRelativePath}/}${exe}" + +printf '%s\n' "" "Program name: ${prog}" "Build type: ${buildType}" "Build without updating: ${buildOnly}" "" + +# Command-line arguments +OPTIND=1 +while getopts "bdh?-" opt; do + case "${opt}" in + b) buildOnly="true" + ;; + d) buildType="debug" + ;; + h|\?|-) printf '%s\n' "This script gets the latest source code for ${prog} and compiles it." \ + "" \ + " -b" \ + " Optional. If specified, the script only compiles the source, it does not try to update the source. If not specified, the source will be updated first." \ + " -d" \ + " Optional. Compile a \"debug\" build. If not specified, a \"release\" build will be made." \ + "" + exit 0 + ;; + esac +done +shift $((OPTIND-1)) +[ "$1" = "--" ] && shift + +# Clone if needed +cloned="false" +updates="false" +if [[ ! -d "$HOME/programs/code-${prog}" ]]; then + mkdir -p "$HOME/programs" || exit 1 + git clone "$repo" "$HOME/programs/code-${prog}" || exit 1 + pushd "$HOME/programs/code-${prog}" || exit 1 + cloned="true" +else + pushd "$HOME/programs/code-${prog}" || exit 1 + git fetch + if [[ $(git rev-parse HEAD) != $(git rev-parse '@{u}') ]]; then + updates="true" + fi +fi + +# Pull updates if necessary +if [[ "$updates" = "true" && "$buildOnly" = "false" ]]; then + git pull || exit 1 +fi + +existsExe="false" +if [[ -e "$HOME/programs/${prog}/${exePath}" ]]; then + existsExe="true" +fi + +# Quit if no updates and build-only flag not set +if [[ "$cloned" = "false" && "$buildOnly" = "false" && "$updates" = "false" && "$existsExe" = "true" ]]; then + printf '%s\n' "No updates, nothing to do." + exit 0 +fi + +# Determine CPU count +cpuCount="fail" +if command -v nproc >/dev/null 2>&1; then + cpuCount="$(nproc --all)" +fi +if [[ ! ( $cpuCount -ge 1 && $cpuCount -le 64 ) ]]; then + cpuCount=1 +fi + +# Prepare folders +rm -rf "$HOME/programs/${prog}" "$HOME/programs/code-${prog}/build" +mkdir -p "$HOME/programs/${prog}" "$HOME/programs/code-${prog}/build" || exit 1 +cd "$HOME/programs/code-${prog}/build" || exit 1 + +# ----------------------------------------------------------------------------- +# Compile + +# See: +# http://rawpedia.rawtherapee.com/Linux#Compile_RawTherapee + +cmake \ + -DCMAKE_BUILD_TYPE="$buildType" \ + -DCACHE_NAME_SUFFIX="5-dev" \ + -DPROC_TARGET_NUMBER="2" \ + -DBUILD_BUNDLE="ON" \ + -DBUNDLE_BASE_INSTALL_DIR="$HOME/programs/${prog}" \ + -DOPTION_OMP="ON" \ + -DWITH_LTO="OFF" \ + -DWITH_PROF="OFF" \ + -DWITH_SAN="OFF" \ + -DWITH_SYSTEM_KLT="OFF" \ + "$HOME/programs/code-${prog}" || exit 1 + +make --jobs="$cpuCount" install || exit 1 + +# Finished +printf '%s\n' "" "To run ${prog} type:" "~/programs/${prog}/${exePath}" "" + +popd 1>/dev/null From 88ebaf618a223f3bb5ccddf15bbb252a26851046 Mon Sep 17 00:00:00 2001 From: gatoatigrado Date: Mon, 25 Dec 2017 18:13:05 -0500 Subject: [PATCH 06/13] Code review changes --- rtengine/LUT.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 4f245634e..9a700bc17 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -95,7 +95,8 @@ protected: // list of variables ordered to improve cache speed unsigned int maxs; float maxsf; - // possibly-more-correct value for sse routine (see unit test for details) + // For the SSE routine operator[](vfloat), we just clip float lookup values + // to just below the max value. float maxIndexFloat; T * data; unsigned int clip; @@ -125,7 +126,10 @@ public: #endif dirty = true; clip = flags; - data = new T[s]; + // Add a few extra elements so [](vfloat) won't access out-of-bounds memory. + // The routine would still produce the right answer, but might cause issues + // with address/heap checking programs. + data = new T[s + 3]; owner = 1; size = s; upperBound = size - 1; @@ -155,7 +159,8 @@ public: dirty = true; // Assumption! clip = flags; - data = new T[s]; + // See comment in constructor. + data = new T[s + 3]; owner = 1; size = s; upperBound = size - 1; @@ -222,7 +227,8 @@ public: } if (this->data == nullptr) { - this->data = new T[rhs.size]; + // See comment in constructor. + this->data = new T[rhs.size + 3]; } this->clip = rhs.clip; @@ -327,7 +333,7 @@ public: vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = clampedIndexes - _mm_cvtepi32_ps(indexes); - return (_mm_set1_ps(1.0f) - diff) * lower + (diff * upper); + return vintpf(diff, upper, lower); } #ifdef __SSE4_1__ template::value>::type> @@ -426,9 +432,7 @@ public: } idx = 0; - // Note: Maybe this should be 'idx > maxsf'? See unit test where a LUT with - // values [10, 11, 12, 13] gets looked up at 2.5 and returns 12.5. - } else if (index > maxsf) { + } else if (idx > maxs) { if (clip & LUT_CLIP_ABOVE) { return data[upperBound]; } From 59e31ed36f179dbb3faff72181e920d892c8f513 Mon Sep 17 00:00:00 2001 From: gatoatigrado Date: Mon, 25 Dec 2017 22:46:05 -0500 Subject: [PATCH 07/13] Code review changes --- rtengine/LUT.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 9a700bc17..b58144a6f 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -310,9 +310,7 @@ public: // Clamp and convert to integer values. Extract out of SSE register because all // lookup operations use regular addresses. - vfloat clampedIndexes = _mm_max_ps( - _mm_setzero_ps(), - _mm_min_ps(_mm_set1_ps(maxIndexFloat), indexv)); + vfloat clampedIndexes = vmaxf(ZEROV, vminf(F2V(maxIndexFloat), indexv)); vint indexes = _mm_cvttps_epi32(clampedIndexes); int indexArray[4]; _mm_storeu_si128(reinterpret_cast<__m128i*>(&indexArray[0]), indexes); From 6dab5742dd6541b5def11589e826c598791e2d14 Mon Sep 17 00:00:00 2001 From: gatoatigrado Date: Mon, 25 Dec 2017 22:50:40 -0500 Subject: [PATCH 08/13] Add comment and assertions --- rtengine/LUT.h | 7 +++++++ rtengine/curves.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index b58144a6f..29147df8b 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -200,6 +200,10 @@ public: clip = flags; } + int getClip() const { + return clip; + } + /** @brief Get the number of element in the LUT (i.e. dimension of the array) * For a LUT(500), it will return 500 * @return number of element in the array @@ -304,6 +308,9 @@ public: } #if defined( __SSE2__ ) && defined( __x86_64__ ) + + // NOTE: This version requires LUTs which clip at upper and lower bounds + // (which is the default). vfloat operator[](vfloat indexv) const { static_assert(std::is_same::value, "This method only works for float LUTs"); diff --git a/rtengine/curves.h b/rtengine/curves.h index 15ab96624..e8b65c33d 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -886,6 +886,8 @@ inline void StandardToneCurve::BatchApply( const size_t start, const size_t end, float *r, float *g, float *b) const { assert (lutToneCurve); + assert (lutToneCurve.getClip() & LUT_CLIP_BELOW); + assert (lutToneCurve.getClip() & LUT_CLIP_ABOVE); // All pointers must have the same alignment for SSE usage. In the loop body below, // we will only check `r`, assuming that the same result would hold for `g` and `b`. From a31f52213db23fcfde648a3b82dfa176a14c8405 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 26 Dec 2017 12:25:10 +0100 Subject: [PATCH 09/13] Fix warning (Wsign-compare) --- rtengine/LUT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 29147df8b..6a617f40b 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -93,7 +93,7 @@ class LUT : { protected: // list of variables ordered to improve cache speed - unsigned int maxs; + int maxs; float maxsf; // For the SSE routine operator[](vfloat), we just clip float lookup values // to just below the max value. From 0e9aab579ef7bbfc684a87ecfc858c9e461bc119 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Wed, 27 Dec 2017 22:55:00 +0100 Subject: [PATCH 10/13] Extract embedded ICC profile from PNG images Fixes #4260 --- rtengine/imageio.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index ff9c9b559..2078cc623 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -308,6 +308,11 @@ int ImageIO::loadPNG (Glib::ustring fname) return IMIO_HEADERERROR; } + // silence the warning about "invalid" sRGB profiles -- see #4260 +#if defined(PNG_SKIP_sRGB_CHECK_PROFILE) && defined(PNG_SET_OPTION_SUPPORTED) + png_set_option(png, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); +#endif + png_infop info = png_create_info_struct (png); png_infop end_info = png_create_info_struct (png); @@ -356,6 +361,22 @@ int ImageIO::loadPNG (Glib::ustring fname) png_set_strip_alpha(png); } + // reading the embedded ICC profile if any + if (png_get_valid(png, info, PNG_INFO_iCCP)) { + png_charp name; + int compression_type; +#if PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR > 4) + png_bytep profdata; +#else + png_charp profdata; +#endif + png_uint_32 proflen; + png_get_iCCP(png, info, &name, &compression_type, &profdata, &proflen); + embProfile = cmsOpenProfileFromMem(profdata, proflen); + loadedProfileData = new char[proflen]; + memcpy(loadedProfileData, profdata, proflen); + } + //setting gamma double gamma; From 527f41c2541414cf443bd3460065111224769356 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Thu, 28 Dec 2017 22:25:04 +0100 Subject: [PATCH 11/13] embed the output profile when writing PNG files Fixes #4262 --- rtengine/imageio.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 2078cc623..ac2c359ca 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -365,10 +365,10 @@ int ImageIO::loadPNG (Glib::ustring fname) if (png_get_valid(png, info, PNG_INFO_iCCP)) { png_charp name; int compression_type; -#if PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR > 4) - png_bytep profdata; -#else +#if PNG_LIBPNG_VER < 10500 png_charp profdata; +#else + png_bytep profdata; #endif png_uint_32 proflen; png_get_iCCP(png, info, &name, &compression_type, &profdata, &proflen); @@ -950,6 +950,11 @@ int ImageIO::savePNG (Glib::ustring fname, volatile int bps) return IMIO_HEADERERROR; } + // silence the warning about "invalid" sRGB profiles -- see #4260 +#if defined(PNG_SKIP_sRGB_CHECK_PROFILE) && defined(PNG_SET_OPTION_SUPPORTED) + png_set_option(png, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); +#endif + png_infop info = png_create_info_struct(png); if (!info) { @@ -980,6 +985,15 @@ int ImageIO::savePNG (Glib::ustring fname, volatile int bps) png_set_IHDR(png, info, width, height, bps, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_BASE); + if (profileData) { +#if PNG_LIBPNG_VER < 10500 + png_charp profdata = reinterpret_cast(profileData); +#else + png_bytep profdata = reinterpret_cast(profileData); +#endif + png_set_iCCP(png, info, const_cast("icc"), 0, profdata, profileLength); + } + int rowlen = width * 3 * bps / 8; unsigned char *row = new unsigned char [rowlen]; From 7dea8a3ea85f5e526e17566a53a250148cf45ba6 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Thu, 28 Dec 2017 22:26:22 +0100 Subject: [PATCH 12/13] added support for writing metadata in PNG files Fixes #3352 --- rtengine/imageio.cc | 94 +++++++++++++++++++++++++++++++++++++++++++++ rtexif/rtexif.cc | 77 +++++++++++++++++++++++++++++++++++++ rtexif/rtexif.h | 1 + 3 files changed, 172 insertions(+) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index ac2c359ca..a8fe9d0da 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -926,6 +926,77 @@ int ImageIO::loadPPMFromMemory(const char* buffer, int width, int height, bool s return IMIO_SUCCESS; } + +namespace { + +// Taken from Darktable -- src/imageio/format/png.c +// +/* Write EXIF data to PNG file. + * Code copied from DigiKam's libs/dimg/loaders/pngloader.cpp. + * The EXIF embedding is defined by ImageMagicK. + * It is documented in the ExifTool page: + * http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/PNG.html + * + * ..and in turn copied from ufraw. thanks to udi and colleagues + * for making useful code much more readable and discoverable ;) + */ + +void PNGwriteRawProfile(png_struct *ping, png_info *ping_info, const char *profile_type, guint8 *profile_data, png_uint_32 length) +{ + png_textp text; + long i; + guint8 *sp; + png_charp dp; + png_uint_32 allocated_length, description_length; + + const guint8 hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + text = static_cast(png_malloc(ping, sizeof(png_text))); + description_length = strlen(profile_type); + allocated_length = length * 2 + (length >> 5) + 20 + description_length; + + text[0].text = static_cast(png_malloc(ping, allocated_length)); + text[0].key = static_cast(png_malloc(ping, 80)); + text[0].key[0] = '\0'; + + g_strlcat(text[0].key, "Raw profile type ", 80); + g_strlcat(text[0].key, profile_type, 80); + + sp = profile_data; + dp = text[0].text; + *dp++ = '\n'; + + g_strlcpy(dp, profile_type, allocated_length); + + dp += description_length; + *dp++ = '\n'; + *dp = '\0'; + + g_snprintf(dp, allocated_length - strlen(text[0].text), "%8lu ", static_cast(length)); + + dp += 8; + + for(i = 0; i < long(length); i++) + { + if(i % 36 == 0) *dp++ = '\n'; + + *(dp++) = hex[((*sp >> 4) & 0x0f)]; + *(dp++) = hex[((*sp++) & 0x0f)]; + } + + *dp++ = '\n'; + *dp = '\0'; + text[0].text_length = (dp - text[0].text); + text[0].compression = -1; + + if(text[0].text_length <= allocated_length) png_set_text(ping, ping_info, text, 1); + + png_free(ping, text[0].text); + png_free(ping, text[0].key); + png_free(ping, text); +} + +} // namespace + int ImageIO::savePNG (Glib::ustring fname, volatile int bps) { if (getWidth() < 1 || getHeight() < 1) { @@ -994,6 +1065,29 @@ int ImageIO::savePNG (Glib::ustring fname, volatile int bps) png_set_iCCP(png, info, const_cast("icc"), 0, profdata, profileLength); } + { + // buffer for the exif and iptc + unsigned int bufferSize; + unsigned char* buffer = nullptr; // buffer will be allocated in createTIFFHeader + unsigned char* iptcdata = nullptr; + unsigned int iptclen = 0; + + if (iptc && iptc_data_save (iptc, &iptcdata, &iptclen) && iptcdata) { + iptc_data_free_buf (iptc, iptcdata); + iptcdata = nullptr; + } + + int size = rtexif::ExifManager::createPNGMarker(exifRoot, exifChange, width, height, bps, (char*)iptcdata, iptclen, buffer, bufferSize); + + if (iptcdata) { + iptc_data_free_buf (iptc, iptcdata); + } + if (buffer && size) { + PNGwriteRawProfile(png, info, "exif", buffer, size); + delete[] buffer; + } + } + int rowlen = width * 3 * bps / 8; unsigned char *row = new unsigned char [rowlen]; diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index a5d10f762..affd530b5 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -3312,6 +3312,83 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro return endOffs; } + +int ExifManager::createPNGMarker(const TagDirectory* root, const rtengine::procparams::ExifPairs &changeList, int W, int H, int bps, const char* iptcdata, int iptclen, unsigned char *&buffer, unsigned &bufferSize) +{ +// write tiff header + int offs = 0; + ByteOrder order = HOSTORDER; + + if (root) { + order = root->getOrder (); + } + + TagDirectory* cl; + + if (root) { + cl = (const_cast (root))->clone (nullptr); + // remove some unknown top level tags which produce warnings when opening a tiff + Tag *removeTag = cl->getTag (0x9003); + + if (removeTag) { + removeTag->setKeep (false); + } + + removeTag = cl->getTag (0x9211); + + if (removeTag) { + removeTag->setKeep (false); + } + } else { + cl = new TagDirectory (nullptr, ifdAttribs, HOSTORDER); + } + + if (iptcdata) { + Tag* iptc = new Tag (cl, lookupAttrib (ifdAttribs, "IPTCData")); + iptc->initLongArray (iptcdata, iptclen); + cl->replaceTag (iptc); + } + +// apply list of changes + for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); ++i) { + cl->applyChange (i->first, i->second); + } + + // append default properties + const std::vector defTags = getDefaultTIFFTags (cl); + + defTags[0]->setInt (W, 0, LONG); + defTags[1]->setInt (H, 0, LONG); + defTags[8]->initInt (0, SHORT, 3); + + for (int i = 0; i < 3; i++) { + defTags[8]->setInt (bps, i * 2, SHORT); + } + + for (int i = defTags.size() - 1; i >= 0; i--) { + Tag* defTag = defTags[i]; + cl->replaceTag (defTag->clone (cl)); + delete defTag; + } + + cl->sort (); + bufferSize = cl->calculateSize() + 8; + buffer = new unsigned char[bufferSize]; // this has to be deleted in caller + sset2 ((unsigned short)order, buffer + offs, order); + offs += 2; + sset2 (42, buffer + offs, order); + offs += 2; + sset4 (8, buffer + offs, order); + + int endOffs = cl->write (8, buffer); + +// cl->printAll(); + delete cl; + + return endOffs; +} + + //----------------------------------------------------------------------------- // global functions to read byteorder dependent data //----------------------------------------------------------------------------- diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index 125d38c94..937945aac 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -361,6 +361,7 @@ public: static std::vector getDefaultTIFFTags (TagDirectory* forthis); static int createJPEGMarker (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, unsigned char* buffer); static int createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char *&buffer, unsigned &bufferSize); + static int createPNGMarker(const TagDirectory *root, const rtengine::procparams::ExifPairs &changeList, int W, int H, int bps, const char *iptcdata, int iptclen, unsigned char *&buffer, unsigned &bufferSize); }; class Interpreter From 5ecb05ba23180ac4b492914415ad96d654b77c03 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Fri, 29 Dec 2017 17:08:15 +0100 Subject: [PATCH 13/13] "Custom command line" label. Changed "Other command line" to "Custom command line". --- rtdata/languages/Catala | 1 - rtdata/languages/Chinese (Simplified) | 1 - rtdata/languages/Chinese (Traditional) | 1 - rtdata/languages/Czech | 1 - rtdata/languages/Dansk | 1 - rtdata/languages/Deutsch | 1 - rtdata/languages/English (UK) | 1 - rtdata/languages/English (US) | 1 - rtdata/languages/Espanol | 1 - rtdata/languages/Euskara | 1 - rtdata/languages/Francais | 1 - rtdata/languages/Greek | 1 - rtdata/languages/Hebrew | 1 - rtdata/languages/Italiano | 1 - rtdata/languages/Japanese | 1 - rtdata/languages/Latvian | 1 - rtdata/languages/Magyar | 1 - rtdata/languages/Nederlands | 1 - rtdata/languages/Norsk BM | 1 - rtdata/languages/Polish | 1 - rtdata/languages/Polish (Latin Characters) | 1 - rtdata/languages/Portugues (Brasil) | 1 - rtdata/languages/Russian | 1 - rtdata/languages/Serbian (Cyrilic Characters) | 1 - rtdata/languages/Serbian (Latin Characters) | 1 - rtdata/languages/Slovak | 1 - rtdata/languages/Suomi | 1 - rtdata/languages/Swedish | 1 - rtdata/languages/Turkish | 1 - rtdata/languages/default | 2 +- 30 files changed, 1 insertion(+), 30 deletions(-) diff --git a/rtdata/languages/Catala b/rtdata/languages/Catala index 7cda54ed5..7768e4037 100644 --- a/rtdata/languages/Catala +++ b/rtdata/languages/Catala @@ -523,7 +523,6 @@ PREFERENCES_DIRLAST;Últim directori usat PREFERENCES_DIROTHER;Un altre PREFERENCES_DIRSELECTDLG;Selecc. directori d'inici... PREFERENCES_DIRSOFTWARE;Instal·lació al directori -PREFERENCES_EDITORCMDLINE;Una altra línia de comandament PREFERENCES_EDITORLAYOUT;Sortida d'editor PREFERENCES_EXTERNALEDITOR;Editor extern PREFERENCES_FBROWSEROPTS;Opcions de navegador i minifotos diff --git a/rtdata/languages/Chinese (Simplified) b/rtdata/languages/Chinese (Simplified) index de1114832..611ead7f8 100644 --- a/rtdata/languages/Chinese (Simplified) +++ b/rtdata/languages/Chinese (Simplified) @@ -550,7 +550,6 @@ PREFERENCES_DIRLAST;上次访问路径 PREFERENCES_DIROTHER;其他 PREFERENCES_DIRSELECTDLG;启动时选择图片路径... PREFERENCES_DIRSOFTWARE;软件安装路径 -PREFERENCES_EDITORCMDLINE;其他命令行 PREFERENCES_EDITORLAYOUT;编辑器布局 PREFERENCES_EXPAUT;进阶 PREFERENCES_EXTERNALEDITOR;外部编辑器 diff --git a/rtdata/languages/Chinese (Traditional) b/rtdata/languages/Chinese (Traditional) index 49f17182b..f539c8dff 100644 --- a/rtdata/languages/Chinese (Traditional) +++ b/rtdata/languages/Chinese (Traditional) @@ -258,7 +258,6 @@ PREFERENCES_DIRLAST;上次訪問路徑 PREFERENCES_DIROTHER;其他 PREFERENCES_DIRSELECTDLG;啟動時選擇圖片路徑... PREFERENCES_DIRSOFTWARE;軟體安裝路徑 -PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EXTERNALEDITOR;External editor PREFERENCES_FBROWSEROPTS;檔流覽選項 PREFERENCES_FILEFORMAT;檔格式 diff --git a/rtdata/languages/Czech b/rtdata/languages/Czech index d881bfb1b..b248ddb21 100644 --- a/rtdata/languages/Czech +++ b/rtdata/languages/Czech @@ -1036,7 +1036,6 @@ PREFERENCES_DIRLAST;Poslední navštívená složka PREFERENCES_DIROTHER;Jiná PREFERENCES_DIRSELECTDLG;Zvolte složku s obrázky při spuštění... PREFERENCES_DIRSOFTWARE;Instalační složka -PREFERENCES_EDITORCMDLINE;Jiný příkaz PREFERENCES_EDITORLAYOUT;Rozvržení editoru PREFERENCES_EXPAUT;Expert PREFERENCES_EXTERNALEDITOR;Externí editor diff --git a/rtdata/languages/Dansk b/rtdata/languages/Dansk index d99c199bf..50c6496a6 100644 --- a/rtdata/languages/Dansk +++ b/rtdata/languages/Dansk @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Sidst anvendte mappe PREFERENCES_DIROTHER;Andet PREFERENCES_DIRSELECTDLG;Vælg startmappe... PREFERENCES_DIRSOFTWARE;Installationsmappe -PREFERENCES_EDITORCMDLINE;Anden kommandostreng PREFERENCES_EXTERNALEDITOR;Eksternt redigeringsprogram PREFERENCES_FBROWSEROPTS;Indstllinger til filbrowser PREFERENCES_FILEFORMAT;Filformat diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index 7b5921af3..d6d729093 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -1052,7 +1052,6 @@ PREFERENCES_DIRLAST;Zuletzt geöffnetes Verzeichnis PREFERENCES_DIROTHER;Anderes PREFERENCES_DIRSELECTDLG;Wähle das Bild-Verzeichnis beim Programmstart... PREFERENCES_DIRSOFTWARE;Installationsverzeichnis -PREFERENCES_EDITORCMDLINE;Befehlszeile PREFERENCES_EDITORLAYOUT;Editor-Layout PREFERENCES_EXPAUT;Experte PREFERENCES_EXTERNALEDITOR;Externer Editor diff --git a/rtdata/languages/English (UK) b/rtdata/languages/English (UK) index be202ff6f..abae3e387 100644 --- a/rtdata/languages/English (UK) +++ b/rtdata/languages/English (UK) @@ -1076,7 +1076,6 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !PREFERENCES_DIROTHER;Other !PREFERENCES_DIRSELECTDLG;Select Image Directory at Startup... !PREFERENCES_DIRSOFTWARE;Installation directory -!PREFERENCES_EDITORCMDLINE;Other command line !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert !PREFERENCES_EXTERNALEDITOR;External Editor diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) index 2df260dc4..bc6c596c4 100644 --- a/rtdata/languages/English (US) +++ b/rtdata/languages/English (US) @@ -1006,7 +1006,6 @@ !PREFERENCES_DIROTHER;Other !PREFERENCES_DIRSELECTDLG;Select Image Directory at Startup... !PREFERENCES_DIRSOFTWARE;Installation directory -!PREFERENCES_EDITORCMDLINE;Other command line !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert !PREFERENCES_EXTERNALEDITOR;External Editor diff --git a/rtdata/languages/Espanol b/rtdata/languages/Espanol index 9fd8eb807..2cc758f06 100644 --- a/rtdata/languages/Espanol +++ b/rtdata/languages/Espanol @@ -770,7 +770,6 @@ PREFERENCES_DIRLAST;Última carpeta visitada PREFERENCES_DIROTHER;Otro PREFERENCES_DIRSELECTDLG;Seleccionar carpeta de imágenes en el arranque... PREFERENCES_DIRSOFTWARE;Carpeta de instalación -PREFERENCES_EDITORCMDLINE;Otra línea de comando PREFERENCES_EDITORLAYOUT;Disposición del editor PREFERENCES_EXTERNALEDITOR;Editor externo PREFERENCES_FBROWSEROPTS;Opciones del explorador de archivos/Miniaturas diff --git a/rtdata/languages/Euskara b/rtdata/languages/Euskara index 88ee5cdac..712bde72f 100644 --- a/rtdata/languages/Euskara +++ b/rtdata/languages/Euskara @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Azkena ikusitako karpeta PREFERENCES_DIROTHER;Besterik PREFERENCES_DIRSELECTDLG;Abioko irudien karpeta hautatu... PREFERENCES_DIRSOFTWARE;Inatalazio karpeta -PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EXTERNALEDITOR;External editor PREFERENCES_FBROWSEROPTS;Arakatzailearen aukerak PREFERENCES_FILEFORMAT;Artxiboen formatua diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index ed1e376b3..1bc815fbf 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -994,7 +994,6 @@ PREFERENCES_DIRLAST;Dernier dossier visité PREFERENCES_DIROTHER;Autre PREFERENCES_DIRSELECTDLG;Choix du dossier Image au lancement... PREFERENCES_DIRSOFTWARE;Dossier d'installation -PREFERENCES_EDITORCMDLINE;Autre ligne de commande PREFERENCES_EDITORLAYOUT;Disposition de l'éditeur PREFERENCES_EXPAUT;Expert PREFERENCES_EXTERNALEDITOR;Éditeur externe diff --git a/rtdata/languages/Greek b/rtdata/languages/Greek index 10e4048c9..cc22986c2 100644 --- a/rtdata/languages/Greek +++ b/rtdata/languages/Greek @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Τελευταία τοποθεσία που χρησιμο PREFERENCES_DIROTHER;Άλλο PREFERENCES_DIRSELECTDLG;Επιλέξτε τοποθεσία εικόνων κατά την έναρξη... PREFERENCES_DIRSOFTWARE;Τοποθεσία εγκατάστασης -PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EXTERNALEDITOR;External editor PREFERENCES_FBROWSEROPTS;Επιλογές περιήγησης αρχείων PREFERENCES_FILEFORMAT;Είδος αρχείου diff --git a/rtdata/languages/Hebrew b/rtdata/languages/Hebrew index 2bb49fc11..bc5c94899 100644 --- a/rtdata/languages/Hebrew +++ b/rtdata/languages/Hebrew @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;תיקיה האחרונה שביקרתי בה PREFERENCES_DIROTHER;אחר PREFERENCES_DIRSELECTDLG;בחר תיקיית צילומים לאתחול PREFERENCES_DIRSOFTWARE;תיקיית התקנה -PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EXTERNALEDITOR;External editor PREFERENCES_FBROWSEROPTS;ברירות דפדפן PREFERENCES_FILEFORMAT;תצורת קובץ diff --git a/rtdata/languages/Italiano b/rtdata/languages/Italiano index 964d891c1..3b577f9a8 100644 --- a/rtdata/languages/Italiano +++ b/rtdata/languages/Italiano @@ -672,7 +672,6 @@ PREFERENCES_DIRLAST;Ultima cartella visitata PREFERENCES_DIROTHER;Altra PREFERENCES_DIRSELECTDLG;Seleziona la cartella delle immagini all'avvio... PREFERENCES_DIRSOFTWARE;Cartella d'installazione -PREFERENCES_EDITORCMDLINE;Altra linea di comando PREFERENCES_EDITORLAYOUT;Disposizione PREFERENCES_EXTERNALEDITOR;Programma di ritocco esterni PREFERENCES_FBROWSEROPTS;Opzioni del Navigatore e delle miniature diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index 4ad937da8..4b60f4985 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -894,7 +894,6 @@ PREFERENCES_DIRLAST;最近参照したディレクトリ PREFERENCES_DIROTHER;他 PREFERENCES_DIRSELECTDLG;起動時の画像ディレクトリ選択... PREFERENCES_DIRSOFTWARE;インストール・ディレクトリ -PREFERENCES_EDITORCMDLINE;その他・コマンド入力 PREFERENCES_EDITORLAYOUT;編集 レイアウト PREFERENCES_EXPAUT;高度 PREFERENCES_EXTERNALEDITOR;外部エディタ diff --git a/rtdata/languages/Latvian b/rtdata/languages/Latvian index 7a4a265fd..e77e90377 100644 --- a/rtdata/languages/Latvian +++ b/rtdata/languages/Latvian @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Pēdējā lietotā mape PREFERENCES_DIROTHER;Cita PREFERENCES_DIRSELECTDLG;Izvēlies attēlu mapi sākumam... PREFERENCES_DIRSOFTWARE;Uzstādīšanas mape -PREFERENCES_EDITORCMDLINE;Cita komandrinda PREFERENCES_EXTERNALEDITOR;Ārējais redaktors PREFERENCES_FBROWSEROPTS;Failu pārlūka iespējas PREFERENCES_FILEFORMAT;Faila formāts diff --git a/rtdata/languages/Magyar b/rtdata/languages/Magyar index f06a57067..82060a2ca 100644 --- a/rtdata/languages/Magyar +++ b/rtdata/languages/Magyar @@ -504,7 +504,6 @@ PREFERENCES_DIRLAST;Utoljára látogatott könyvtár PREFERENCES_DIROTHER;Más PREFERENCES_DIRSELECTDLG;Képek könyvtára induláskor... PREFERENCES_DIRSOFTWARE;Telepítés helye -PREFERENCES_EDITORCMDLINE;Egyéb parancssor PREFERENCES_EDITORLAYOUT;Szerkesztési mód PREFERENCES_EXTERNALEDITOR;Külső képszerkesztő program PREFERENCES_FBROWSEROPTS;Állományböngésző beállításai diff --git a/rtdata/languages/Nederlands b/rtdata/languages/Nederlands index 4679183a4..cb7c85eb6 100644 --- a/rtdata/languages/Nederlands +++ b/rtdata/languages/Nederlands @@ -979,7 +979,6 @@ PREFERENCES_DIRLAST;Laatst bezochte map PREFERENCES_DIROTHER;Anders PREFERENCES_DIRSELECTDLG;Selecteer standaardmap bij opstarten... PREFERENCES_DIRSOFTWARE;Installatiemap -PREFERENCES_EDITORCMDLINE;Andere editor, geef pad PREFERENCES_EDITORLAYOUT;Bewerkingsvenster PREFERENCES_EXPAUT;Expert PREFERENCES_EXTERNALEDITOR;Externe editor diff --git a/rtdata/languages/Norsk BM b/rtdata/languages/Norsk BM index 30dc287cc..2106de2da 100644 --- a/rtdata/languages/Norsk BM +++ b/rtdata/languages/Norsk BM @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Sidste besøkte mappe PREFERENCES_DIROTHER;Annen PREFERENCES_DIRSELECTDLG;Velg bildemappe ved oppstart... PREFERENCES_DIRSOFTWARE;Installasjons-mappe -PREFERENCES_EDITORCMDLINE;Annen kommandolinje PREFERENCES_EXTERNALEDITOR;Ekstern editor PREFERENCES_FBROWSEROPTS;Filfremviser-innstillinger PREFERENCES_FILEFORMAT;Filformat diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index 1ff05df61..e6aa12154 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -725,7 +725,6 @@ PREFERENCES_DIRLAST;Ostatnio odwiedzony katalog PREFERENCES_DIROTHER;Inny PREFERENCES_DIRSELECTDLG;Wybierz katalog z obrazami po uruchomieniu... PREFERENCES_DIRSOFTWARE;Katalog instalacyjny -PREFERENCES_EDITORCMDLINE;Inna linia poleceń PREFERENCES_EDITORLAYOUT;Układ edytora PREFERENCES_EXTERNALEDITOR;Zewnętrzny edytor PREFERENCES_FBROWSEROPTS;Opcje przeglądarki plików diff --git a/rtdata/languages/Polish (Latin Characters) b/rtdata/languages/Polish (Latin Characters) index 1f461f887..89d222f1e 100644 --- a/rtdata/languages/Polish (Latin Characters) +++ b/rtdata/languages/Polish (Latin Characters) @@ -725,7 +725,6 @@ PREFERENCES_DIRLAST;Ostatnio odwiedzony katalog PREFERENCES_DIROTHER;Inny PREFERENCES_DIRSELECTDLG;Wybierz katalog z obrazami po uruchomieniu... PREFERENCES_DIRSOFTWARE;Katalog instalacyjny -PREFERENCES_EDITORCMDLINE;Inna linia polecen PREFERENCES_EDITORLAYOUT;Uklad edytora PREFERENCES_EXTERNALEDITOR;Zewnetrzny edytor PREFERENCES_FBROWSEROPTS;Opcje przegladarki plikow diff --git a/rtdata/languages/Portugues (Brasil) b/rtdata/languages/Portugues (Brasil) index 6453da0fe..488cff769 100644 --- a/rtdata/languages/Portugues (Brasil) +++ b/rtdata/languages/Portugues (Brasil) @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Último directory visitado PREFERENCES_DIROTHER;Outro PREFERENCES_DIRSELECTDLG;selecionar diretório de imagem na inicialização... PREFERENCES_DIRSOFTWARE;Diretório de instalação -PREFERENCES_EDITORCMDLINE;Outra Linha de Comando PREFERENCES_EXTERNALEDITOR;Editor externo PREFERENCES_FBROWSEROPTS;Opções do navegador de arquivos PREFERENCES_FILEFORMAT;Formato de arquivo diff --git a/rtdata/languages/Russian b/rtdata/languages/Russian index 4cf168bbd..9b6f8e4d8 100644 --- a/rtdata/languages/Russian +++ b/rtdata/languages/Russian @@ -656,7 +656,6 @@ PREFERENCES_DIRLAST;Последний каталог PREFERENCES_DIROTHER;Другой PREFERENCES_DIRSELECTDLG;Каталог, открываемый при запуске программы PREFERENCES_DIRSOFTWARE;Каталог установки -PREFERENCES_EDITORCMDLINE;Другой (путь к исполняемому файлу) PREFERENCES_EDITORLAYOUT;Тип редактора PREFERENCES_EXTERNALEDITOR;Внешний редактор PREFERENCES_FBROWSEROPTS;Настройки diff --git a/rtdata/languages/Serbian (Cyrilic Characters) b/rtdata/languages/Serbian (Cyrilic Characters) index bd65f2a9f..a0745b12d 100644 --- a/rtdata/languages/Serbian (Cyrilic Characters) +++ b/rtdata/languages/Serbian (Cyrilic Characters) @@ -642,7 +642,6 @@ PREFERENCES_DIRLAST;Последњи директоријум PREFERENCES_DIROTHER;Неки други PREFERENCES_DIRSELECTDLG;Бира одређени директоријум са сликама... PREFERENCES_DIRSOFTWARE;Директоријум са инсталацијом -PREFERENCES_EDITORCMDLINE;Произвољна наредба PREFERENCES_EDITORLAYOUT;Размештај програма PREFERENCES_EXTERNALEDITOR;Спољни уређивач PREFERENCES_FBROWSEROPTS;Опције разгледача датотеке diff --git a/rtdata/languages/Serbian (Latin Characters) b/rtdata/languages/Serbian (Latin Characters) index bc12eb72d..00d47c71e 100644 --- a/rtdata/languages/Serbian (Latin Characters) +++ b/rtdata/languages/Serbian (Latin Characters) @@ -642,7 +642,6 @@ PREFERENCES_DIRLAST;Poslednji direktorijum PREFERENCES_DIROTHER;Neki drugi PREFERENCES_DIRSELECTDLG;Bira određeni direktorijum sa slikama... PREFERENCES_DIRSOFTWARE;Direktorijum sa instalacijom -PREFERENCES_EDITORCMDLINE;Proizvoljna naredba PREFERENCES_EDITORLAYOUT;Razmeštaj programa PREFERENCES_EXTERNALEDITOR;Spoljni uređivač PREFERENCES_FBROWSEROPTS;Opcije razgledača datoteke diff --git a/rtdata/languages/Slovak b/rtdata/languages/Slovak index f680a30f1..0d388659c 100644 --- a/rtdata/languages/Slovak +++ b/rtdata/languages/Slovak @@ -293,7 +293,6 @@ PREFERENCES_DIRLAST;Posledný navštívený adresár PREFERENCES_DIROTHER;Iný PREFERENCES_DIRSELECTDLG;Vybrať adresár s obrázkami pri spustení... PREFERENCES_DIRSOFTWARE;Inštalačný adresár -PREFERENCES_EDITORCMDLINE;Iný príkazový riadok PREFERENCES_EDITORLAYOUT;Rozloženie editora PREFERENCES_EXTERNALEDITOR;Externý editor PREFERENCES_FBROWSEROPTS;Voľby prehliadača súborov diff --git a/rtdata/languages/Suomi b/rtdata/languages/Suomi index 98cc1abdd..5a96989f8 100644 --- a/rtdata/languages/Suomi +++ b/rtdata/languages/Suomi @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Viimeksi käytetty hakemisto PREFERENCES_DIROTHER;Muu PREFERENCES_DIRSELECTDLG;Valitse kuvahakemisto käynnistettäessä... PREFERENCES_DIRSOFTWARE;Asennushakemisto -PREFERENCES_EDITORCMDLINE;Muu komentorivi PREFERENCES_EXTERNALEDITOR;Ulkoinen ohjelma PREFERENCES_FBROWSEROPTS;Näytettävät tiedot PREFERENCES_FILEFORMAT;Tallennuksen asetukset diff --git a/rtdata/languages/Swedish b/rtdata/languages/Swedish index d37357514..a09aff7c4 100644 --- a/rtdata/languages/Swedish +++ b/rtdata/languages/Swedish @@ -883,7 +883,6 @@ PREFERENCES_DIRLAST;Senaste besökta katalog PREFERENCES_DIROTHER;Annan PREFERENCES_DIRSELECTDLG;Välj bildkatalog vid uppstart... PREFERENCES_DIRSOFTWARE;Installationskatalog -PREFERENCES_EDITORCMDLINE;Annan kommandorad PREFERENCES_EDITORLAYOUT;Layout för redigeringsvyn PREFERENCES_EXPAUT;Expert PREFERENCES_EXTERNALEDITOR;Externt bildredigeringsprogram diff --git a/rtdata/languages/Turkish b/rtdata/languages/Turkish index ec2016ed6..8f307e05c 100644 --- a/rtdata/languages/Turkish +++ b/rtdata/languages/Turkish @@ -249,7 +249,6 @@ PREFERENCES_DIRLAST;Son gidilen dizin PREFERENCES_DIROTHER;Diğer PREFERENCES_DIRSELECTDLG;Başlangıç görüntü dizinini seç... PREFERENCES_DIRSOFTWARE;Kurulum dizini -PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EXTERNALEDITOR;External editor PREFERENCES_FBROWSEROPTS;Dosya gezgini seçenekleri PREFERENCES_FILEFORMAT;Dosya biçimi diff --git a/rtdata/languages/default b/rtdata/languages/default index f4361fc5d..b4156e0d4 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1005,7 +1005,7 @@ PREFERENCES_DIRLAST;Last visited directory PREFERENCES_DIROTHER;Other PREFERENCES_DIRSELECTDLG;Select Image Directory at Startup... PREFERENCES_DIRSOFTWARE;Installation directory -PREFERENCES_EDITORCMDLINE;Other command line +PREFERENCES_EDITORCMDLINE;Custom command line PREFERENCES_EDITORLAYOUT;Editor Layout PREFERENCES_EXPAUT;Expert PREFERENCES_EXTERNALEDITOR;External Editor