Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/thumbs.c
| Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | #endif | ||||
| s += BLI_strncpy_rlen(s, subdir, FILE_MAX - (s - dir)); | s += BLI_strncpy_rlen(s, subdir, FILE_MAX - (s - dir)); | ||||
| (void)s; | (void)s; | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| #undef THUMBNAILS | #undef THUMBNAILS | ||||
| /** ----- begin of adapted code from glib --- | /* --- Begin of adapted code from glib. --- */ | ||||
| /* -------------------------------------------------------------------- */ | |||||
| /** \name Escape URI String | |||||
| * | |||||
| * The following code is adapted from function g_escape_uri_string from the gnome glib | * The following code is adapted from function g_escape_uri_string from the gnome glib | ||||
| * Source: http://svn.gnome.org/viewcvs/glib/trunk/glib/gconvert.c?view=markup | * Source: http://svn.gnome.org/viewcvs/glib/trunk/glib/gconvert.c?view=markup | ||||
| * released under the Gnu General Public License. | * released under the Gnu General Public License. | ||||
| */ | * | ||||
| * \{ */ | |||||
| typedef enum { | typedef enum { | ||||
| UNSAFE_ALL = 0x1, /* Escape all unsafe characters */ | UNSAFE_ALL = 0x1, /* Escape all unsafe characters */ | ||||
| UNSAFE_ALLOW_PLUS = 0x2, /* Allows '+' */ | UNSAFE_ALLOW_PLUS = 0x2, /* Allows '+' */ | ||||
| UNSAFE_PATH = 0x8, /* Allows '/', '&', '=', ':', '@', '+', '$' and ',' */ | UNSAFE_PATH = 0x8, /* Allows '/', '&', '=', ':', '@', '+', '$' and ',' */ | ||||
| UNSAFE_HOST = 0x10, /* Allows '/' and ':' and '@' */ | UNSAFE_HOST = 0x10, /* Allows '/' and ':' and '@' */ | ||||
| UNSAFE_SLASHES = 0x20, /* Allows all characters except for '/' and '%' */ | UNSAFE_SLASHES = 0x20, /* Allows all characters except for '/' and '%' */ | ||||
| } UnsafeCharacterSet; | } UnsafeCharacterSet; | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | else { | ||||
| *q++ = *p; | *q++ = *p; | ||||
| escaped_string_size -= 1; | escaped_string_size -= 1; | ||||
| } | } | ||||
| } | } | ||||
| *q = '\0'; | *q = '\0'; | ||||
| } | } | ||||
| /** ----- end of adapted code from glib --- */ | /** \} */ | ||||
| /* --- End of adapted code from glib. --- */ | |||||
| static bool thumbhash_from_path(const char *UNUSED(path), ThumbSource source, char *r_hash) | static bool thumbhash_from_path(const char *UNUSED(path), ThumbSource source, char *r_hash) | ||||
| { | { | ||||
| switch (source) { | switch (source) { | ||||
| case THB_SOURCE_FONT: | case THB_SOURCE_FONT: | ||||
| return IMB_thumb_load_font_get_hash(r_hash); | return IMB_thumb_load_font_get_hash(r_hash); | ||||
| default: | default: | ||||
| r_hash[0] = '\0'; | r_hash[0] = '\0'; | ||||
| ▲ Show 20 Lines • Show All 520 Lines • Show Last 20 Lines | |||||