From: Øyvind Kolås Date: Sun, 18 Aug 2019 23:00:11 +0000 (+0200) Subject: babl: reduce default max path length to 3 (5) X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~11^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7084fc49bb78c9ea9df354498fda62cded557ee6;p=babl.git babl: reduce default max path length to 3 (5) With the space invasion progressing, we're starting to have many more conversions to search through - in some cases looking for conversions - when there are no conversions become too expensive with an exhaustive search of all conversions up to 7 steps. (it is likely possible to reduce the amount of conversions tried). As well re-enable handling of grayscale ICC profiles - since the formerly patological tests on gimp now pass. --- diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 130b6b8..9d6a0c6 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -103,7 +103,7 @@ static int max_path_length (void); static int debug_conversions = 0; int _babl_instrument = 0; -double +double _babl_legal_error (void) { static double error = 0.0; @@ -133,7 +133,7 @@ _babl_legal_error (void) return error; } -static int +static int max_path_length (void) { static int max_length = 0; @@ -146,9 +146,11 @@ max_path_length (void) if (env) max_length = atoi (env); else - max_length = 4; /* reducing this number makes finding short fishes much + max_length = 3; /* reducing this number makes finding short fishes much faster - even if we lose out on some of the fast - bigger fish + bigger fish, the fishes we can get with a max_length of 3 + is actually 5, since we deepen the search twice if no + sufficient results are found. */ if (max_length > BABL_HARD_MAX_PATH_LENGTH) max_length = BABL_HARD_MAX_PATH_LENGTH; @@ -157,7 +159,7 @@ max_path_length (void) return max_length; } -int +int _babl_max_path_len (void) { return max_path_length (); diff --git a/babl/babl-format.c b/babl/babl-format.c index 20617d2..2e4e3d7 100644 --- a/babl/babl-format.c +++ b/babl/babl-format.c @@ -130,6 +130,7 @@ format_new (const char *name, babl->format.space = (void*)space; babl->format.encoding = NULL; babl->instance.doc = doc; + return babl; } diff --git a/babl/babl-icc.c b/babl/babl-icc.c index 9808c75..96cc166 100644 --- a/babl/babl-icc.c +++ b/babl/babl-icc.c @@ -996,9 +996,7 @@ babl_space_from_icc (const char *icc_data, if (strcmp (color_space.str, "RGB ") -#if 0 /* XXX: commented out, as gimp-2.99 doesn't like loading grayscale jpegs with grayscale icc profiles when it is enabled */ && strcmp (color_space.str, "GRAY") -#endif ) { *error = "not defining RGB, CMYK or GRAY space..";