...
 
Commits (35)
......@@ -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",
......
darktable (2.4.3-1) unstable; urgency=medium
* New upstream bugfix release
-- David Bremner <bremner@debian.org> Mon, 07 May 2018 19:30:50 -0300
darktable (2.4.2-1) unstable; urgency=medium
* New upstream bugfix release
......
......@@ -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])
{ "Olympus E-PL5", { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ "Olympus E-PL6", { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ "Olympus E-PL7", { 9197,-3190,-659,-2606,10830,2039,-458,1250,5458 } },
{ "Olympus E-PL9", { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ "Olympus E-PM1", { 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "Olympus E-PM2", { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ "Olympus E-M10", { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
......@@ -519,6 +521,7 @@ static void dt_dcraw_adobe_coeff(const char *name, float cam_xyz[1][12])
{ "Panasonic DC-FZ82", { 8550,-2908,-842,-3195,11529,1881,-338,1603,4631 } },
{ "Panasonic DC-GH5", { 7641,-2336,-605,-3218,11299,2187,-485,1338,5121 } },
{ "Panasonic DC-G9", { 7685,-2375,-634,-3687,11700,2249,-748,1546,5111 } },
{ "Panasonic DC-GX9", { 7564,-2263,-606,-3148,11239,2177,-540,1435,4853 } },
{ "Panasonic DC-TZ90", { 9052,-3117,-883,-3045,11346,1927,-205,1520,4730 } },
{ "Phase One H 20", { 1313,1855,-109,-6715,15908,808,-327,1840,6020 } }, /* DJC */
{ "Phase One H 25", { 2905,732,-237,-8134,16626,1476,-3038,4253,7517 } },
......@@ -574,6 +577,7 @@ static void dt_dcraw_adobe_coeff(const char *name, float cam_xyz[1][12])
{ "Sony DSC-RX10M4", { 7699,-2566,-629,-2967,11270,1928,-378,1286,4807 } },
{ "Sony DSC-RX10", { 6679,-1825,-745,-5047,13256,1953,-1580,2422,5183 } },
{ "Sony DSC-RX1R", { 6344,-1612,-462,-4863,12477,2681,-865,1786,6899 } },
{ "Sony DSC-RX1RM2", { 6629,-1900,-483,-4618,12349,2550,-622,1381,6514 } },
{ "Sony DSC-RX1", { 6344,-1612,-462,-4863,12477,2681,-865,1786,6899 } },
{ "Sony DSC-RX0", { 9396,-3507,-843,-2497,11111,1572,-343,1355,5089 } },
{ "Sony DSLR-A100", { 9437,-2811,-774,-8405,16215,2290,-710,596,7181 } },
......@@ -602,6 +606,7 @@ static void dt_dcraw_adobe_coeff(const char *name, float cam_xyz[1][12])
{ "Sony ILCE-7RM3", { 6640,-1847,-503,-5238,13010,2474,-993,1673,6527 } },
{ "Sony ILCE-7R", { 4913,-541,-202,-6130,13513,2906,-1564,2151,7183 } },
{ "Sony ILCE-7M2", { 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 } },
{ "Sony ILCE-7M3", { 7374,-2389,-551,-5435,13162,2519,-1006,1795,6552 } },
{ "Sony ILCE-7", { 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 } },
{ "Sony ILCE-3000", { 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
{ "Sony ILCE-3500", { 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
......
......@@ -37,7 +37,7 @@ RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes
RUN echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissin
ENV GCC_VER=7
ENV LLVM_VER=5.0
ENV LLVM_VER=6.0
# pls keep sorted :)
RUN rm -rf /var/lib/apt/lists/* && apt-get update && \
......
---
Checks: '*,-clang-analyzer-*,-clang-diagnostic-*,-cert-dcl50-cpp,-cert-env33-c,-cert-err58-cpp,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-member-init,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-google-default-arguments,-google-readability-todo,-google-runtime-int,-hicpp-member-init,-hicpp-special-member-functions,-llvm-header-guard,-llvm-include-order,-misc-unused-parameters,-readability-implicit-bool-cast,-readability-inconsistent-declaration-parameter-name,-android-*,-hicpp-braces-around-statements,-hicpp-function-size,-google-readability-braces-around-statements,-google-readability-function-size,-readability-implicit-bool-conversion,-hicpp-signed-bitwise,-hicpp-no-array-decay,-hicpp-vararg,-cppcoreguidelines-owning-memory,-fuchsia-*,-readability-simd-intrinsics'
Checks: '*,-clang-analyzer-*,-clang-diagnostic-*,-cert-dcl50-cpp,-cert-env33-c,-cert-err58-cpp,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-member-init,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-google-default-arguments,-google-readability-todo,-google-runtime-int,-hicpp-member-init,-hicpp-special-member-functions,-llvm-header-guard,-llvm-include-order,-misc-unused-parameters,-readability-implicit-bool-cast,-readability-inconsistent-declaration-parameter-name,-android-*,-hicpp-braces-around-statements,-hicpp-function-size,-google-readability-braces-around-statements,-google-readability-function-size,-readability-implicit-bool-conversion,-hicpp-signed-bitwise,-hicpp-no-array-decay,-hicpp-vararg,-hicpp-multiway-paths-covered,-cppcoreguidelines-owning-memory,-fuchsia-*,-portability-simd-intrinsics'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
......@@ -17,6 +17,8 @@ CheckOptions:
value: '7'
- key: readability-function-size.NestingThreshold
value: '6'
- key: readability-function-size.VariableThreshold
value: '30'
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
value: '1'
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
......@@ -31,6 +33,8 @@ CheckOptions:
value: 'h,hh,hpp,hxx,'
- key: misc-definitions-in-headers.UseHeaderFileExtension
value: '1'
- key: modernize-use-auto.MinTypeNameLength
value: '0'
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: google-runtime-references.WhiteListTypes
......
......@@ -88,13 +88,13 @@ jobs:
sudo: required
services:
- docker
env: CC=clang-5.0 CXX=clang++-5.0 TARGET=STATICANALYSIS
env: CC=clang-6.0 CXX=clang++-6.0 TARGET=STATICANALYSIS ECO="-DUSE_CLANG_TIDY=ON"
- os: linux
dist: trusty
sudo: required
services:
- docker
env: CC=clang-5.0 CXX=clang++-5.0 ECO="-DWITH_PTHREADS=OFF"
env: CC=clang-6.0 CXX=clang++-6.0 ECO="-DWITH_PTHREADS=OFF"
- os: linux
dist: trusty
sudo: required
......@@ -117,7 +117,7 @@ jobs:
sudo: required
services:
- docker
env: CC=clang-5.0 CXX=clang++-5.0 TARGET=WWW
env: CC=clang-6.0 CXX=clang++-6.0 TARGET=WWW
# linux clang Coverage build OOM's in gcov during final codecov report collection
# OSX gcc Coverage build produces invalid .gcno files
......@@ -146,7 +146,7 @@ script:
export CMD="$SRC_DIR/.ci/ci-script.sh";
if [[ "$TARGET" == "STATICANALYSIS" ]]; then
export TARGET="build";
export CMD="scan-build-5.0 --use-cc=\"$CC\" --use-c++=\"$CXX\" --force-analyze-debug-code --status-bugs -disable-checker deadcode.DeadStores $CMD";
export CMD="scan-build-6.0 --use-cc=\"$CC\" --use-c++=\"$CXX\" --force-analyze-debug-code --status-bugs -disable-checker deadcode.DeadStores $CMD";
fi;
if [[ "$TARGET" == "SONARQUBE" ]]; then
export TARGET="build";
......
......@@ -39,7 +39,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(BINARY_PACKAGE_BUILD "Sets march optimization to generic" OFF)
option(WITH_SSE2 "If SSE2 support is avaliable, do build SSE2 codepaths" ON)
option(WITH_SSE2 "If SSE2 support is available, do build SSE2 codepaths" ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
option(RAWSPEED_USE_LIBCXX "(Clang only) Build using libc++ as the standard library." OFF)
......
......@@ -81,7 +81,7 @@ The main objectives were to make a very fast loader that worked for 75% of the c
RawSpeed is not at the moment a separate library, so you have to include it in your project directly.
Please see <http://rawspeed.org/> for documentation.
Doxygen-generated documentation is avaliable at <http://rawspeed.org/doxygen>
Doxygen-generated documentation is available at <http://rawspeed.org/doxygen>
Submitting Requests and Patches
--------------------------------------------------------------------------------
......
......@@ -75,4 +75,4 @@ static constexpr const iPoint2D S420(2, 2);
BENCHMARK_TEMPLATE(BM_Cr2sRawInterpolator, S420, v<1>)->Apply(CustomArguments);
BENCHMARK_TEMPLATE(BM_Cr2sRawInterpolator, S420, v<2>)->Apply(CustomArguments);
BENCHMARK_MAIN();
BENCHMARK_MAIN()
find_program(CLANGTIDY_PATH NAMES clang-tidy clang-tidy-5.0 clang-tidy-4.0)
find_program(CLANGTIDY_PATH NAMES clang-tidy clang-tidy-6.0)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LLVMClangTidy
......
......@@ -13,7 +13,7 @@ else()
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(LibFuzzingEngine_PROCESS_LIBS LibFuzzingEngine_LIBRARY)
libfind_process(LibFuzzingEngine)
......
......@@ -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)
......@@ -20,4 +20,4 @@ if(WITH_OPENMP)
else()
message(STATUS "OpenMP is disabled, utilities will not use openmp-based parallelization")
endif()
add_feature_info("OpenMP-based utilites threading" HAVE_OPENMP "used for parallelization of utilities only, NOT library!")
add_feature_info("OpenMP-based utilities threading" HAVE_OPENMP "used for parallelization of utilities only, NOT library!")
......@@ -20,7 +20,7 @@ endif(NOT CMAKE_BUILD_TYPE)
# yes, these build types need to be specified here in upper-case.
set(SPECIAL_BUILD_TYPES COVERAGE SANITIZE TSAN FUZZ)
set(CMAKE_CONFIGURATION_TYPES DEBUG RELWITHDEBINFO RELEASE ${SPECIAL_BUILD_TYPES})
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "All the avaliable build types" FORCE)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "All the available build types" FORCE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}." FORCE )
......
......@@ -8,12 +8,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_L
message(FATAL_ERROR "GNU C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is too old. Need 5.0+")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "LLVM Clang C compiler version ${CMAKE_C_COMPILER_VERSION} is too old. Need 3.4+")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.5)
message(FATAL_ERROR "LLVM Clang C compiler version ${CMAKE_C_COMPILER_VERSION} is too old. Need 3.5+")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "LLVM Clang C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is too old. Need 3.4+")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
message(FATAL_ERROR "LLVM Clang C++ compiler version ${CMAKE_CXX_COMPILER_VERSION} is too old. Need 3.5+")
endif()
# if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
......
......@@ -29,6 +29,11 @@ set (CLANG_DISABLED_WARNING_FLAGS
"zero-as-null-pointer-constant" # temporary
)
# Yes, these have to be *re-enabled* after CLANG_DISABLED_WARNING_FLAGS.
set (CLANG_REENABLED_WARNING_FLAGS
"extra-semi"
)
set(CMAKE_REQUIRED_FLAGS_ORIG "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "-c -Wunreachable-code -Werror=unreachable-code")
# see https://reviews.llvm.org/D25321
......@@ -60,3 +65,7 @@ endforeach()
foreach(warning ${CLANG_DISABLED_WARNING_FLAGS})
CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(-Wno-${warning})
endforeach()
foreach(warning ${CLANG_REENABLED_WARNING_FLAGS})
CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(-W${warning})
endforeach()
......@@ -17,7 +17,7 @@ find_package(Find REQUIRED)
set(GCOV_OPTS "-pb")
if(NOT APPLE)
# DONT elide source prefix.
# DON'T elide source prefix.
set(GCOV_OPTS ${GCOV_OPTS} -aflu)
endif()
......@@ -29,7 +29,7 @@ add_custom_target(
USES_TERMINAL
)
# DONT remove *.gcov files here!
# DON'T remove *.gcov files here!
add_custom_target(
gcov-clean
COMMAND "${FIND_PATH}" "${CMAKE_BINARY_DIR}" -type f -name '*.gcda' -delete > /dev/null
......
......@@ -4294,6 +4294,17 @@
<Crop x="8" y="8" width="-24" height="-8"/>
<Sensor black="0" white="4095"/>
</Camera>
<Camera make="OLYMPUS CORPORATION" model="E-PL9">
<ID make="Olympus" model="E-PL9">Olympus E-PL9</ID>
<CFA width="2" height="2">
<Color x="0" y="0">RED</Color>
<Color x="1" y="0">GREEN</Color>
<Color x="0" y="1">GREEN</Color>
<Color x="1" y="1">BLUE</Color>
</CFA>
<Crop x="8" y="8" width="-24" height="-8"/>
<Sensor black="248" white="4000"/>
</Camera>
<Camera make="OLYMPUS IMAGING CORP." model="E-P5">
<ID make="Olympus" model="E-P5">Olympus E-P5</ID>
<CFA width="2" height="2">
......@@ -7265,6 +7276,28 @@
<Crop x="0" y="0" width="-58" height="0"/>
<Sensor black="148" white="4095"/>
</Camera>
<Camera make="Panasonic" model="DC-GX9">
<ID make="Panasonic" model="DC-GX9">Panasonic DC-GX9</ID>
<CFA width="2" height="2">
<Color x="0" y="0">BLUE</Color>
<Color x="1" y="0">GREEN</Color>
<Color x="0" y="1">GREEN</Color>
<Color x="1" y="1">RED</Color>
</CFA>
<Crop x="0" y="0" width="-66" height="0"/>
<Sensor black="143" white="4095"/>
</Camera>
<Camera make="Panasonic" model="DC-GX9" mode="4:3">
<ID make="Panasonic" model="DC-GX9">Panasonic DC-GX9</ID>
<CFA width="2" height="2">
<Color x="0" y="0">BLUE</Color>
<Color x="1" y="0">GREEN</Color>
<Color x="0" y="1">GREEN</Color>
<Color x="1" y="1">RED</Color>
</CFA>
<Crop x="0" y="0" width="-66" height="0"/>
<Sensor black="143" white="4095"/>
</Camera>
<Camera make="Panasonic" model="DC-TZ90">
<ID make="Panasonic" model="DC-TZ90">Panasonic DC-ZS70</ID>
<CFA width="2" height="2">
......@@ -8027,6 +8060,17 @@
<Vertical x="6032" width="14"/>
</BlackAreas>
</Camera>
<Camera make="SONY" model="DSC-RX1RM2">
<ID make="Sony" model="DSC-RX1RM2">Sony DSC-RX1RM2</ID>
<CFA width="2" height="2">
<Color x="0" y="0">RED</Color>
<Color x="1" y="0">GREEN</Color>
<Color x="0" y="1">GREEN</Color>
<Color x="1" y="1">BLUE</Color>
</CFA>
<Crop x="0" y="0" width="-40" height="0"/>
<Sensor black="512" white="16300"/>
</Camera>
<Camera make="SONY" model="DSLR-A100" decoder_version="1">
<ID make="Sony" model="DSLR-A100">Sony DSLR-A100</ID>
<CFA width="2" height="2">
......@@ -8424,6 +8468,17 @@
<Crop x="0" y="0" width="-26" height="0"/>
<Sensor black="512" white="16300"/>
</Camera>
<Camera make="SONY" model="ILCE-7M3">
<ID make="Sony" model="ILCE-7M3">Sony ILCE-7M3</ID>
<CFA width="2" height="2">
<Color x="0" y="0">RED</Color>
<Color x="1" y="0">GREEN</Color>
<Color x="0" y="1">GREEN</Color>
<Color x="1" y="1">BLUE</Color>
</CFA>
<Crop x="0" y="0" width="0" height="0"/>
<Sensor black="512" white="16300"/>
</Camera>
<Camera make="SONY" model="ILCE-7R">
<ID make="Sony" model="ILCE-7R">Sony ILCE-7R</ID>
<CFA width="2" height="2">
......@@ -9150,6 +9205,32 @@
<Crop x="4" y="0" width="-52" height="0"/>
<Sensor black="1024" white="16383"/>
</Camera>
<Camera make="FUJIFILM" model="X-H1">
<ID make="Fujifilm" model="X-H1">Fujifilm X-H1</ID>
<CFA2 width="6" height="6">
<ColorRow y="0">RBGBRG</ColorRow>
<ColorRow y="1">GGRGGB</ColorRow>
<ColorRow y="2">GGBGGR</ColorRow>
<ColorRow y="3">BRGRBG</ColorRow>
<ColorRow y="4">GGBGGR</ColorRow>
<ColorRow y="5">GGRGGB</ColorRow>
</CFA2>
<Crop x="0" y="0" width="-132" height="0"/>
<Sensor black="1024" white="16383"/>
</Camera>
<Camera make="FUJIFILM" model="X-H1" mode="compressed">
<ID make="Fujifilm" model="X-H1">Fujifilm X-H1</ID>
<CFA2 width="6" height="6">
<ColorRow y="0">GGRGGB</ColorRow>
<ColorRow y="1">GGBGGR</ColorRow>
<ColorRow y="2">BRGRBG</ColorRow>
<ColorRow y="3">GGBGGR</ColorRow>
<ColorRow y="4">GGRGGB</ColorRow>
<ColorRow y="5">RBGBRG</ColorRow>
</CFA2>
<Crop x="0" y="18" width="-18" height="-6"/>
<Sensor black="1024" white="16383"/>
</Camera>
<Camera make="FUJIFILM" model="X-M1">
<ID make="Fujifilm" model="X-M1">Fujifilm X-M1</ID>
<CFA2 width="6" height="6">
......@@ -9685,6 +9766,17 @@
<Crop x="3" y="0" width="-3" height="0"/>
<Sensor black="19" white="7638"/>
</Camera>
<Camera make="KODAK" model="EOSDCS3C FILE VERSION 3">
<ID make="Kodak" model="EOS DCS 3">Kodak EOSDCS3</ID>
<CFA width="2" height="2">
<Color x="0" y="0">GREEN</Color>
<Color x="1" y="0">RED</Color>
<Color x="0" y="1">BLUE</Color>
<Color x="1" y="1">GREEN</Color>
</CFA>
<Crop x="6" y="0" width="-6" height="0"/>
<Sensor black="0" white="7855"/>
</Camera>
<Camera make="EASTMAN KODAK COMPANY" model="KODAK P880 ZOOM DIGITAL CAMERA">
<ID make="Kodak" model="P880">Kodak P880</ID>
<CFA width="2" height="2">
......
......@@ -44,17 +44,16 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
rawspeed::RawImage mRaw(CreateRawImage(&bs));
using slice_type = int;
std::vector<slice_type> slicesWidths;
const unsigned sliceCount = bs.getU32();
bs.check(sliceCount, sizeof(slice_type));
slicesWidths.reserve(sliceCount);
std::generate_n(std::back_inserter(slicesWidths), sliceCount,
[&bs]() -> slice_type { return bs.get<slice_type>(); });
using slice_type = rawspeed::ushort16;
const auto numSlices = bs.get<slice_type>();
const auto sliceWidth = bs.get<slice_type>();
const auto lastSliceWidth = bs.get<slice_type>();
const rawspeed::Cr2Slicing slicing(numSlices, sliceWidth, lastSliceWidth);
rawspeed::Cr2Decompressor c(bs, mRaw);
mRaw->createData();
c.decode(std::move(slicesWidths));
c.decode(slicing);
mRaw->checkMemIsInitialized();
} catch (rawspeed::RawspeedException&) {
......
......@@ -46,7 +46,7 @@ rawspeed::RawImage CreateRawImage(rawspeed::ByteStream* bs) {
mRaw->isCFA = isCFA;
return mRaw;
};
}
rawspeed::ColorFilterArray CreateCFA(rawspeed::ByteStream* bs) {
assert(bs);
......@@ -74,4 +74,4 @@ rawspeed::ColorFilterArray CreateCFA(rawspeed::ByteStream* bs) {
}
return cfa;
};
}
/*
RawSpeed - RAW file decoder.
Copyright (C) 2016-2017 Roman Lebedev
Copyright (C) 2016-2018 Roman Lebedev
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -40,7 +40,7 @@
#cmakedefine HAVE_CXX_THREAD_LOCAL
#cmakedefine HAVE_GCC_THREAD_LOCAL
// which aligned memory allocation function is avaliable, if any?
// which aligned memory allocation function is available, if any?
// only the first one found will be enabled
#cmakedefine HAVE_POSIX_MEMALIGN
#cmakedefine HAVE_ALIGNED_ALLOC
......@@ -62,32 +62,3 @@
#ifndef __has_extension
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
// see https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#include <sanitizer/asan_interface.h> // IWYU pragma: export
#include <type_traits> // for remove_cv
template <typename T> struct remove_all_const : std::remove_const<T> {};
template <typename T> struct remove_all_const<T *> {
using type = typename remove_all_const<T>::type *;
};
template <typename T> struct remove_all_const<T *const> {
using type = typename remove_all_const<T>::type *;
};
#define ASAN_REGION_IS_POISONED(addr, size) \
__asan_region_is_poisoned( \
const_cast<remove_all_const<decltype(addr)>::type>(addr), /* NOLINT */ \
(size))
#else
#define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define ASAN_REGION_IS_POISONED(addr, size) (0)
#endif
#if __has_feature(memory_sanitizer) || defined(__SANITIZE_MEMORY__)
#include <sanitizer/msan_interface.h> // IWYU pragma: export
#define MSAN_MEM_IS_INITIALIZED(addr, size) \
__msan_check_mem_is_initialized(addr, size)
#else
#define MSAN_MEM_IS_INITIALIZED(addr, size) (0)
#endif
/*
RawSpeed - RAW file decoder.
Copyright (C) 2018 Roman Lebedev
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include <cstddef> // for size_t
// see http://clang.llvm.org/docs/LanguageExtensions.html
#ifndef __has_feature // Optional of course.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef __has_extension
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#include <sanitizer/asan_interface.h>
#endif
namespace rawspeed {
struct ASan final {
// Do not instantiate.
ASan() = delete;
ASan(const ASan&) = delete;
ASan(ASan&&) = delete;
ASan& operator=(const ASan&) = delete;
ASan& operator=(ASan&&) = delete;
~ASan() = delete;
// Marks memory region [addr, addr+size) as unaddressable.
static void PoisonMemoryRegion(void const volatile* addr, size_t size);
// Marks memory region [addr, addr+size) as addressable.
static void UnPoisonMemoryRegion(void const volatile* addr, size_t size);
// If at least one byte in [beg, beg+size) is poisoned, return true
// Otherwise return 0.
static bool RegionIsPoisoned(void const volatile* addr, size_t size);
};
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
inline void ASan::PoisonMemoryRegion(void const volatile* addr, size_t size) {
__asan_poison_memory_region(addr, size);
}
inline void ASan::UnPoisonMemoryRegion(void const volatile* addr, size_t size) {
__asan_unpoison_memory_region(addr, size);
}
inline bool ASan::RegionIsPoisoned(void const volatile* addr, size_t size) {
auto* beg = const_cast<void*>(addr); // NOLINT
return nullptr != __asan_region_is_poisoned(beg, size);
}
#else
inline void ASan::PoisonMemoryRegion(void const volatile* addr, size_t size) {
// If we are building without ASan, then there is no way to have a non-empty
// body of this function. It's better than to have a macros, or to use
// preprocessor in every place it is called.
}
inline void ASan::UnPoisonMemoryRegion(void const volatile* addr, size_t size) {
// If we are building without ASan, then there is no way to have a non-empty
// body of this function. It's better than to have a macros, or to use
// preprocessor in every place it is called.
}
inline bool ASan::RegionIsPoisoned(void const volatile* addr, size_t size) {
// If we are building without ASan, then there is no way to have a poisoned
// memory region.
return false;
}
#endif
} // namespace rawspeed