Commit 7eb10a40 authored by David Bremner's avatar David Bremner

Merge tag 'upstream/2.4.3'

downloaded from github
parents 6ed87e2e 0be266f9
......@@ -79,6 +79,7 @@ option(VALIDATE_APPDATA_FILE "Use appstream-util (if found) to validate the .app
option(BUILD_TESTS "Build tests in src/tests/, runnable from the build/ directory" OFF)
option(BUILD_BATTERY_INDICATOR "Add an icon to the top toolbar showing the state of a laptop battery" OFF)
option(BUILD_MSYS2_INSTALL "Build an MSYS2 version of the install, aka for Windows platform, but without dependency installs" OFF)
option(BUILD_NOISE_TOOLS "Build tools for generating noise proifles" OFF)
if(USE_OPENCL)
option(TESTBUILD_OPENCL_PROGRAMS "Test-compile opencl programs (needs llvm and clang 3.9+)" ON)
......@@ -219,7 +220,7 @@ else(DEFINED PROJECT_VERSION)
else(NOT SOURCE_PACKAGE)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/src/version_gen.c)
# should be expanded by git archive due to export-subst in .gitattributes
set(PROJECT_VERSION "archive-6305f8363de0e349f7947b701efb54e035ac0709")
set(PROJECT_VERSION "archive-a09bf23d6c61aec66643cd05f7d7784c33047988")
# but was it expanded?
if(PROJECT_VERSION MATCHES Format)
set(PROJECT_VERSION "unknown-version")
......@@ -544,6 +545,7 @@ include(data/supported_extensions.cmake) # this file needs to be included first
add_subdirectory(src) # src/ needs to be before data/ so that the correct CSS file gets installed
add_subdirectory(data)
add_subdirectory(doc)
add_subdirectory(tools)
# This contains fixup_bundle
# And adding a separate subderectory as a last one will make sure
......
we’re proud to announce the second bugfix release for the 2.4 series of darktable, 2.4.2!
we’re proud to announce the third bugfix release for the 2.4 series of darktable, 2.4.3!
the github release is here: [https://github.com/darktable-org/darktable/releases/tag/release-2.4.2](https://github.com/darktable-org/darktable/releases/tag/release-2.4.2).
the github release is here: [https://github.com/darktable-org/darktable/releases/tag/release-2.4.3](https://github.com/darktable-org/darktable/releases/tag/release-2.4.3).
as always, please don't use the autogenerated tarball provided by github, but only our tar.xz. the checksums are:
```
$ sha256sum darktable-2.4.2.tar.xz
??? darktable-2.4.2.tar.xz
$ sha256sum darktable-2.4.2.dmg
??? darktable-2.4.2.dmg
$ sha256sum darktable-2.4.2-win64.exe
??? darktable-2.4.2-win64.exe
$ sha256sum darktable-2.4.2-win64.zip
??? darktable-2.4.2-win64.zip
$ sha256sum darktable-2.4.3.tar.xz
??? darktable-2.4.3.tar.xz
$ sha256sum darktable-2.4.3.dmg
??? darktable-2.4.3.dmg
$ sha256sum darktable-2.4.3-win64.exe
??? darktable-2.4.3-win64.exe
$ sha256sum darktable-2.4.3-win64.zip
??? darktable-2.4.3-win64.zip
```
when updating from the currently stable 2.2.x series, please bear in mind that your edits will be preserved during this process, but it will not be possible to downgrade from 2.4 to 2.2.x any more.
#### Important note: to make sure that darktable can keep on supporting the raw file format for your camera, *please* read [this post](https://discuss.pixls.us/t/raw-samples-wanted/5420?u=lebedevri) on how/what raw samples you can contribute to ensure that we have the *full* raw sample set for your camera under CC0 license!
and the changelog as compared to 2.4.1 can be found below.
and the changelog as compared to 2.4.2 can be found below.
## New Features
- Add presets to location search in map mode
- Add timestamps to the output of `-d` command line switches
- Add a compression level slider to the TIFF export module
- Add native binary NetPNM loading, without using GraphicsMagick
- Add a battery indicator for people running darktable on a laptop. This is not very portable code and disabled by default
- Allow to use /? to show the help message on Windows
- Support for tags and ratings in the watermark module
- Read Xmp.exif.DateTimeOriginal from XMP sidecars
- Build and install noise tools
- Add a script for converting .dtyle to an .xmp
## Bugfixes
- Turn off smooth scrolling for X11/Quartz. That might help with oversensitive scrolling
- Fix reading and writing of TIFFs with non-ASCII filenames on Windows
- Ellipsize background job labels when too long
- Hard code D50 white point when exporting to OpenEXR
- Add tootips to the haze removal module
- Fix a crash when changing lenses while tethering
- Fix incorrect Atom CPU detection on Windows
- Revised performance configuration
- Don't overlay the colorbalance sliders on the left for a cleaner look
- Honor local copy in copy export format
- Make trashing of files on Windows silent
- Fix string termination override on memmove
- Fix a use after free and some memleaks
- Fix a crash in PDF export
- Fix the min color picker
- Don't hardcode '/' in OpenCL paths on Windows
## Camera support, compared to 2.4.1
- Don't create unneeded folders during export in some cases
- When collecting by tags, don't select subtags
- Fix language selection on OSX
- Fix a crash while tethering
## Camera support, compared to 2.4.2
#### Warning: support for Nikon NEF 'lossy after split' raws was unintentionally broken due to the lack of such samples. Please see [this post](https://discuss.pixls.us/t/nikon-a-specific-raw-sample-wanted/5483?u=lebedevri) for more details. If you have affected raws, please contribute samples!
### Base Support
- Canon PowerShot G1 X Mark III
- Panasonic DMC-FZ2000 (3:2)
- Panasonic DMC-FZ2500 (3:2)
- Panasonic DMC-ZS100 (3:2)
- Sony DSC-RX0
- Sony DSC-RX10M4
- Fujifilm X-H1 (compressed)
- Kodak EOS DCS 3
- Olympus E-PL9
- Panasonic DC-GX9 (4:3)
- Sony DSC-RX1RM2
- Sony ILCE-7M3
### White Balance Presets
- Sony ILCE-7M3
### Noise Profiles
- Canon EOS 200D
- Canon EOS Kiss X9
- Canon EOS Rebel SL2
- Canon EOS 760D
- Canon EOS 8000D
- Canon EOS Rebel T6s
- Canon PowerShot G1 X Mark II
- Canon PowerShot G9 X
- Fujifilm X100F
- Nikon D850
- Panasonic DC-G9
- Panasonic DMC-GF6
- Panasonic DMC-LX10
- Panasonic DMC-LX15
- Panasonic DMC-LX9
- Panasonic DMC-TZ70
- Panasonic DMC-TZ71
- Panasonic DMC-ZS50
## Translations
- Dutch
- French
- German
- Hungarian
- Italian
- Canon PowerShot G1 X Mark III
- Nikon D7500
- Sony ILCE-7M3
......@@ -20,6 +20,6 @@ find_library(GIO_LIBRARY
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
libfind_process(GIO)
......@@ -34,7 +34,7 @@ find_library(Glib_LIBRARY
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
set(Glib_PROCESS_LIBS Glib_LIBRARY)
libfind_process(Glib)
......@@ -24,7 +24,7 @@ find_library(JsonGlib_LIBRARY
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(JsonGlib_PROCESS_INCLUDES ${JsonGlib_INCLUDE_DIR})
set(JsonGlib_PROCESS_LIBS ${JsonGlib_LIBRARY})
libfind_process(JsonGlib)
......
......@@ -23,7 +23,7 @@ find_library(OpenJPEG_LIBRARY
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(OpenJPEG_PROCESS_INCLUDES OpenJPEG_INCLUDE_DIR)
set(OpenJPEG_PROCESS_LIBS OpenJPEG_LIBRARY)
libfind_process(OpenJPEG)
......@@ -24,7 +24,7 @@ elseif(Pugixml_INCLUDE_DIR)
endif()
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(Pugixml_PROCESS_INCLUDES Pugixml_INCLUDE_DIR)
set(Pugixml_PROCESS_LIBS Pugixml_LIBRARY)
libfind_process(Pugixml)
......@@ -17,7 +17,7 @@ if (Sqlite3_PKGCONF_VERSION)
endif()
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(Sqlite3_PROCESS_INCLUDES Sqlite3_INCLUDE_DIR)
set(Sqlite3_PROCESS_LIBS Sqlite3_LIBRARY)
libfind_process(Sqlite3)
This diff is collapsed.
......@@ -50,7 +50,7 @@
"type": "string",
"pattern": "^[a-zA-Z0-9\\- \\*]+$",
"minLength": 2,
"maxLength": 22
"maxLength": 23
},
"profiles": {
"type": "array",
......@@ -60,14 +60,14 @@
"properties": {
"name": {
"type": "string",
"pattern": "^[a-zA-Z0-9\\- \\*]+ iso [0-9]{2,6}$",
"pattern": "^[a-zA-Z0-9\\- \\*]+ iso [0-9]{2,7}$",
"minLength": 9,
"maxLength": 32
"maxLength": 33
},
"iso": {
"type": "integer",
"minimum": 31,
"maximum": 256000
"maximum": 2048000
},
"a": {
"type": "array",
......
......@@ -23,7 +23,7 @@ How to make disk image with darktable application bundle (64 bit Intel only):
$ portindex ~/ports
Add "file:///Users/<username>/ports" (change <username> to your actual login) to /opt/local/etc/macports/sources.conf before [default] line.
Install required dependencies:
$ sudo port install git exiv2 libgphoto2 gtk-osx-application-gtk3 lensfun librsvg libsoup openexr json-glib flickcurl GraphicsMagick openjpeg lua webp libsecret pugixml osm-gps-map adwaita-icon-theme tango-icon-theme intltool
$ sudo port install git exiv2 libgphoto2 gtk-osx-application-gtk3 lensfun librsvg libsoup openexr json-glib flickcurl GraphicsMagick openjpeg lua webp libsecret pugixml osm-gps-map adwaita-icon-theme tango-icon-theme intltool iso-codes
To have working OpenMP (at least partly, only for C source files) you will also need gcc6:
$ sudo port install gcc6
(llvm port, which gets installed as dependency, won't compile with macosx_deployment_target set, so comment it out when llvm is built)
......
......@@ -159,4 +159,4 @@ for arg in "$@"; do
done
unset arg
exec $GTK_DEBUG_GDB "$bundle_contents"/MacOS/"$name"-bin "$@" $SPLIT_ARGS --datadir "$bundle_data"/darktable --moduledir "$bundle_lib"/darktable --localedir "$bundle_data"/locale $EXTRA_ARGS
exec $GTK_DEBUG_GDB "$bundle_contents"/MacOS/"$name"-bin "$@" $SPLIT_ARGS $EXTRA_ARGS
......@@ -22,6 +22,7 @@
<binary>${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so</binary>
<binary>${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so</binary>
<translations name="gtk30">${prefix}/share/locale</translations>
<translations name="iso_639">${prefix}/share/locale</translations>
<translations name="darktable">${prefix:dt}/share/locale</translations>
<data>${prefix:dt}/share/darktable</data>
<data>${prefix}/share/glib-2.0/schemas/org.gtk.Settings.*.gschema.xml</data>
......@@ -30,6 +31,7 @@
<data dest="${bundle}/Contents/Resources/etc/gtk-3.0/settings.ini">${project}/settings.ini</data>
<data>${prefix}/share/mime</data>
<data>${prefix}/share/curl/curl-ca-bundle.crt</data>
<data>${prefix}/share/iso-codes/json/iso_639-2.json</data>
<data dest="${bundle}/Contents/Resources/Icons.icns">${project}/Icons.icns</data>
<data dest="${bundle}/Contents/Resources/share/applications/defaults.list">${project}/defaults.list</data>
<data dest="${bundle}/Contents/Resources/share/applications/open.desktop">${project}/open.desktop</data>
......
......@@ -151,4 +151,4 @@ if expr "$1" : '^-psn_' > /dev/null; then
shift 1
fi
exec $GTK_DEBUG_GDB "$bundle_contents"/MacOS/"$name"-bin --datadir "$bundle_data"/darktable --moduledir "$bundle_lib"/darktable --localedir "$bundle_data"/locale $EXTRA_ARGS "$@"
exec $GTK_DEBUG_GDB "$bundle_contents"/MacOS/"$name"-bin $EXTRA_ARGS "$@"
......@@ -685,7 +685,7 @@ static gint _compare_camera_by_port(gconstpointer a, gconstpointer b)
{
dt_camera_t *ca = (dt_camera_t *)a;
dt_camera_t *cb = (dt_camera_t *)b;
return strcmp(ca->port, cb->port);
return g_strcmp0(ca->port, cb->port);
}
void dt_camctl_detect_cameras(const dt_camctl_t *c)
......@@ -722,10 +722,10 @@ void dt_camctl_detect_cameras(const dt_camctl_t *c)
dt_pthread_mutex_init(&camera->live_view_pixbuf_mutex, NULL);
dt_pthread_mutex_init(&camera->live_view_synch, NULL);
// if(strcmp(camera->port,"usb:")==0) { g_free(camera); continue; }
// if(g_strcmp0(camera->port,"usb:")==0) { g_free(camera); continue; }
GList *citem;
if((citem = g_list_find_custom(c->cameras, camera, _compare_camera_by_port)) == NULL
|| strcmp(((dt_camera_t *)citem->data)->model, camera->model) != 0)
|| g_strcmp0(((dt_camera_t *)citem->data)->model, camera->model) != 0)
{
if(citem == NULL)
{
......@@ -1571,7 +1571,7 @@ static void _camera_configuration_notify_change(const dt_camctl_t *c, const dt_c
else
if(gp_widget_get_value(old_config_child, &old_config_value) != GP_OK) goto end;
if(strcmp(new_config_value, old_config_value) != 0)
if(g_strcmp0(new_config_value, old_config_value) != 0)
_dispatch_camera_property_value_changed(c, camera, new_config_name, new_config_value);
end:
......
......@@ -914,7 +914,7 @@ static gchar *get_query_string(const dt_collection_properties_t property, const
break;
case DT_COLLECTION_PROP_TAG: // tag
query = dt_util_dstrcat(query, "(id IN (SELECT imgid FROM main.tagged_images AS a JOIN "
"data.tags AS b ON a.tagid = b.id WHERE name LIKE '%1$s' OR name like '%1$s|%%'))",
"data.tags AS b ON a.tagid = b.id WHERE name LIKE '%s'))",
escaped_text);
break;
......
......@@ -440,6 +440,7 @@ int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load
char *noiseprofiles_from_command = NULL;
char *datadir_from_command = NULL;
char *moduledir_from_command = NULL;
char *localedir_from_command = NULL;
char *tmpdir_from_command = NULL;
char *configdir_from_command = NULL;
char *cachedir_from_command = NULL;
......@@ -587,7 +588,8 @@ int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load
}
else if(!strcmp(argv[k], "--localedir") && argc > k + 1)
{
bindtextdomain(GETTEXT_PACKAGE, argv[++k]);
localedir_from_command = argv[++k];
bindtextdomain(GETTEXT_PACKAGE, localedir_from_command);
argv[k-1] = NULL;
argv[k] = NULL;
}
......@@ -731,6 +733,7 @@ int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load
#endif
dt_loc_init_datadir(datadir_from_command);
dt_loc_init_plugindir(moduledir_from_command);
dt_loc_init_localedir(localedir_from_command);
if(dt_loc_init_tmp_dir(tmpdir_from_command))
{
fprintf(stderr, "error: invalid temporary directory: %s\n", darktable.tmpdir);
......
......@@ -230,6 +230,7 @@ typedef struct darktable_t
char *progname;
char *datadir;
char *plugindir;
char *localedir;
char *tmpdir;
char *configdir;
char *cachedir;
......
......@@ -339,6 +339,32 @@ static bool dt_exif_read_xmp_data(dt_image_t *img, Exiv2::XmpData &xmpData, int
free(adr);
}
/* read timestamp from Xmp.exif.DateTimeOriginal */
if(FIND_XMP_TAG("Xmp.exif.DateTimeOriginal"))
{
char *datetime = strdup(pos->toString().c_str());
/*
* exiftool (but apparently not evix2) convert
* e.g. "2017:10:23 12:34:56" to "2017-10-23T12:34:54" (ISO)
* revert this to the format expected by exif and darktable
*/
// replace 'T' by ' ' (space)
char *c ;
while ( ( c = strchr(datetime,'T') ) != NULL )
{
*c = ' ';
}
// replace '-' by ':'
while ( ( c = strchr(datetime,'-')) != NULL ) {
*c = ':';
}
g_strlcpy(img->exif_datetime_taken, datetime, sizeof(img->exif_datetime_taken));
free(datetime);
}
return true;
}
catch(Exiv2::AnyError &e)
......
......@@ -30,6 +30,10 @@
#include <config.h>
#endif
#ifdef __APPLE__
#include "osx/osx.h"
#endif
#include "darktable.h"
#include "file_location.h"
......@@ -93,44 +97,17 @@ void dt_loc_init_user_config_dir(const char *configdir)
g_free(default_config_dir);
}
#if defined(__MACH__) || defined(__APPLE__)
#ifdef __APPLE__
char *dt_loc_find_install_dir(const char *suffix, const char *searchname)
{
gchar *curr = g_get_current_dir();
int contains = 0;
char tmp[PATH_MAX] = { 0 };
for(int k = 0; searchname[k] != 0; k++)
if(searchname[k] == '/')
{
contains = 1;
break;
}
if(searchname[0] == '/') // absolute path
snprintf(tmp, sizeof(tmp), "%s", searchname);
else if(contains) // relative path
snprintf(tmp, sizeof(tmp), "%s/%s", curr, searchname);
else
{
// no idea where we have been called. use compiled in path
g_free(curr);
return NULL;
}
size_t len = MIN(strlen(tmp), sizeof(tmp));
char *t = tmp + len; // strip off bin/darktable
for(; t > tmp && *t != '/'; t--)
;
t--;
if(*t == '.' && *(t - 1) != '.')
{
for(; t > tmp && *t != '/'; t--)
;
t--;
}
for(; t > tmp && *t != '/'; t--)
;
g_strlcpy(t, suffix, sizeof(tmp) - (t - tmp));
g_free(curr);
return g_strdup(tmp);
char *result = NULL;
char *res_path = dt_osx_get_bundle_res_path();
if(res_path)
result = g_build_filename(res_path, suffix, NULL);
g_free(res_path);
return result;
}
#elif defined(_WIN32)
char *dt_loc_find_install_dir(const char *suffix, const char *searchname)
......@@ -152,8 +129,9 @@ char *dt_loc_find_install_dir(const char *suffix, const char *searchname)
*slash = '\0';
finaldir = g_build_filename(runtime_prefix, suffix, NULL);
g_free(runtime_prefix);
return g_strdup(finaldir);
return finaldir;
}
#endif
......@@ -173,37 +151,38 @@ void dt_loc_init_user_cache_dir(const char *cachedir)
void dt_loc_init_plugindir(const char *plugindir)
{
#if defined(__MACH__) || defined(__APPLE__) || defined(_WIN32)
#if defined(__APPLE__) || defined(_WIN32)
char *suffix = g_build_filename("lib", "darktable", NULL);
char *directory = dt_loc_find_install_dir(suffix, darktable.progname);
g_free(suffix);
if(plugindir || !directory)
{
darktable.plugindir = dt_loc_init_generic(plugindir, DARKTABLE_LIBDIR);
}
else
{
darktable.plugindir = directory;
}
darktable.plugindir = dt_loc_init_generic(plugindir, directory ? directory : DARKTABLE_LIBDIR);
g_free(directory);
#else
darktable.plugindir = dt_loc_init_generic(plugindir, DARKTABLE_LIBDIR);
#endif
}
void dt_loc_init_localedir(const char *localedir)
{
#if defined(__APPLE__) || defined(_WIN32)
char *suffix = g_build_filename("share", "locale", NULL);
char *directory = dt_loc_find_install_dir(suffix, darktable.progname);
g_free(suffix);
darktable.localedir = dt_loc_init_generic(localedir, directory ? directory : DARKTABLE_LOCALEDIR);
g_free(directory);
#else
darktable.localedir = dt_loc_init_generic(localedir, DARKTABLE_LOCALEDIR);
#endif
}
void dt_loc_init_datadir(const char *datadir)
{
#if defined(__MACH__) || defined(__APPLE__) || defined(_WIN32)
#if defined(__APPLE__) || defined(_WIN32)
char *suffix = g_build_filename("share", "darktable", NULL);
char *directory = dt_loc_find_install_dir(suffix, darktable.progname);
g_free(suffix);
if(datadir || !directory)
{
darktable.datadir = dt_loc_init_generic(datadir, DARKTABLE_DATADIR);
}
else
{
darktable.datadir = directory;
}
darktable.datadir = dt_loc_init_generic(datadir, directory ? directory : DARKTABLE_DATADIR);
g_free(directory);
#else
darktable.datadir = dt_loc_init_generic(datadir, DARKTABLE_DATADIR);
#endif
......@@ -215,6 +194,11 @@ void dt_loc_get_plugindir(char *plugindir, size_t bufsize)
snprintf(plugindir, bufsize, "%s", darktable.plugindir);
}
void dt_loc_get_localedir(char *localedir, size_t bufsize)
{
snprintf(localedir, bufsize, "%s", darktable.localedir);
}
void dt_loc_get_user_config_dir(char *configdir, size_t bufsize)
{
snprintf(configdir, bufsize, "%s", darktable.configdir);
......
......@@ -28,6 +28,8 @@ gchar *dt_loc_get_home_dir(const gchar *user);
void dt_loc_init_datadir(const char *datadir);
/** get the plugin dir */
void dt_loc_init_plugindir(const char *plugindir);
/** init the locale dir */
void dt_loc_init_localedir(const char *localedir);
/** get user local dir */
int dt_loc_init_tmp_dir(const char *tmpdir);
/** get user config dir */
......@@ -38,6 +40,7 @@ void dt_loc_init_user_cache_dir(const char *cachedir);
/* temporary backward_compatibility*/
void dt_loc_get_datadir(char *datadir, size_t bufsize);
void dt_loc_get_plugindir(char *plugindir, size_t bufsize);
void dt_loc_get_localedir(char *localedir, size_t bufsize);
void dt_loc_get_tmp_dir(char *tmpdir, size_t bufsize);
void dt_loc_get_user_config_dir(char *configdir, size_t bufsize);
void dt_loc_get_user_cache_dir(char *cachedir, size_t bufsize);
......
......@@ -861,7 +861,7 @@ float dt_interpolation_compute_sample(const struct dt_interpolation *itor, const
}
else
{
// invalide coordinate
// invalid coordinate
r = 0.0f;
}
return r;
......
......@@ -23,6 +23,10 @@
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
#ifdef __APPLE__
#include "osx/osx.h"
#endif
#ifdef _WIN32
#include "win/dtwin.h"
#include <windows.h>
......@@ -64,13 +68,22 @@ static void get_language_names(GList *languages)
JsonReader *reader = NULL;
JsonParser *parser = NULL;
GError *error = NULL;
char *filename;
#ifdef __APPLE__
char *res_path = dt_osx_get_bundle_res_path();
#endif
#if defined(_WIN32) && !defined(MSYS2_INSTALL) // TODO: add osx?
#if defined(_WIN32) && !defined(MSYS2_INSTALL)
char datadir[PATH_MAX] = { 0 };
dt_loc_get_datadir(datadir, sizeof(datadir));
char *filename = g_build_filename(datadir, "..", "iso-codes", "json", "iso_639-2.json", NULL);
filename = g_build_filename(datadir, "..", "iso-codes", "json", "iso_639-2.json", NULL);
#else
char *filename = g_build_filename(ISO_CODES_LOCATION, "iso_639-2.json", NULL);
#ifdef __APPLE__
if(res_path)
filename = g_build_filename(res_path, "share", "iso-codes", "json", "iso_639-2.json", NULL);
else
#endif
filename = g_build_filename(ISO_CODES_LOCATION, "iso_639-2.json", NULL);
#endif
if(!g_file_test(filename, G_FILE_TEST_EXISTS))
......@@ -80,12 +93,21 @@ static void get_language_names(GList *languages)
goto end;
}
#if defined(_WIN32) && !defined(MSYS2_INSTALL) // TODO: add osx?
#if defined(_WIN32) && !defined(MSYS2_INSTALL)
// on windows we are shipping the translations of iso-codes along ours
char *localedir = g_build_filename(datadir, "..", "locale", NULL);
char localedir[PATH_MAX] = { 0 };
dt_loc_get_localedir(localedir, sizeof(localedir));
bindtextdomain("iso_639", localedir);
g_free(localedir);
#else
#ifdef __APPLE__
if(res_path)
{
char localedir[PATH_MAX] = { 0 };
dt_loc_get_localedir(localedir, sizeof(localedir));
bindtextdomain("iso_639", localedir);
}
else
#endif
bindtextdomain("iso_639", ISO_CODES_LOCALEDIR);
#endif
......@@ -199,6 +221,9 @@ static void get_language_names(GList *languages)
end:
// cleanup
#ifdef __APPLE__
g_free(res_path);
#endif
g_free(filename);
if(error) g_error_free(error);
if(reader) g_object_unref(reader);
......@@ -252,13 +277,8 @@ dt_l10n_t *dt_l10n_init(gboolean init_list)
const gchar * const * default_languages = g_get_language_names();
#ifdef _WIN32
char datadir[PATH_MAX] = { 0 };
dt_loc_get_datadir(datadir, sizeof(datadir));
char *localedir = g_build_filename(datadir, "..", "locale", NULL);
#else
char * localedir = g_strdup(DARKTABLE_LOCALEDIR);
#endif
char localedir[PATH_MAX] = { 0 };
dt_loc_get_localedir(localedir, sizeof(localedir));
GDir *dir = g_dir_open(localedir, 0, NULL);
if(dir)
{
......@@ -333,8 +353,6 @@ dt_l10n_t *dt_l10n_init(gboolean init_list)
if(selected == NULL)
result->selected = result->sys_default;
g_free(localedir);
}
else
set_locale(ui_lang, old_env);
......
......@@ -1382,7 +1382,7 @@ int dt_opencl_lock_device(const int pipetype)
while(*prio != -1)
{
if(!dt_pthread_mutex_trylock(&cl->dev[*prio].lock))
if(!dt_pthread_mutex_BAD_trylock(&cl->dev[*prio].lock))
{
int devid = *prio;
free(priority);
......@@ -1406,7 +1406,7 @@ int dt_opencl_lock_device(const int pipetype)
for(int try_dev = 0; try_dev < cl->num_devs; try_dev++)
{
// get first currently unused processor
if(!dt_pthread_mutex_trylock(&cl->dev[try_dev].lock)) return try_dev;
if(!dt_pthread_mutex_BAD_trylock(&cl->dev[try_dev].lock)) return try_dev;
}
}
......
......@@ -3,7 +3,7 @@
#if !defined(_RELEASE) && !defined(__cplusplus) && !defined(_WIN32)
//
// We needed to poison certaion functions in order to disallow their usage
// We needed to poison certain functions in order to disallow their usage
// but not in bundled libs
//
......
......@@ -63,7 +63,7 @@
* The following example shows a general use case for the C++
* bindings, including support for the optional exception feature and
* also the supplied vector and string classes, see following sections for
* decriptions of these features.
* descriptions of these features.
*
* \code
* #define __CL_ENABLE_EXCEPTIONS
......
......@@ -198,6 +198,7 @@ static void dt_dcraw_adobe_coeff(const char *name, float cam_xyz[1][12])
{ "Fujifilm X-E2", { 8458,-2451,-855,-4597,12447,2407,-1475,2482,6526 } },
{ "Fujifilm X-E3", { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
{ "Fujifilm X-E2S", { 11562,-5118,-961,-3022,11007,2311,-525,1569,6097 } },
{ "Fujifilm X-H1", { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
{ "Fujifilm X-M1", { 10413,-3996,-993,-3721,11640,2361,-733,1540,6011 } },
{ "Fujifilm X-S1", { 13509,-6199,-1254,-4430,12733,1865,-331,1441,5022 } },
{ "Fujifilm X-T10", { 8458,-2451,-855,-4597,12447,2407,-1475,2482,6526 } },
......@@ -219,7 +220,7 @@ static void dt_dcraw_adobe_coeff(const char *name, float cam_xyz[1][12])
{ "KODAK DCS420", { 10868,-1852,-644,-1537,11083,484,2343,628,2216 } },
{ "Kodak DCS460D", { 10592,-2206,-967,-1944,11685,230,2206,670,1273 } },
{ "Kodak EOS DCS 1", { 10592,-2206,-967,-1944,11685,230,2206,670,1273 } },
{ "KODAK EOSDCS3B", { 9898,-2700,-940,-2478,12219,206,1985,634,1031 } },
{ "Kodak EOS DCS 3", { 9898,-2700,-940,-2478,12219,206,1985,634,1031 } },
{ "Kodak DCS520C", { 24542,-10860,-3401,-1490,11370,-297,2858,-605,3225 } },
{ "Kodak DCS560C", { 20482,-7172,-3125,-1033,10410,-285,2542,226,3136 } },
{ "Kodak DCS620C", { 23617,-10175,-3149,-2054,11749,-272,2586,-489,3453 } },
......@@ -388,6 +389,7 @@ static void dt_dcraw_adobe_coeff(const char *name, float cam_xyz[1][12])