Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/thumbs.c')
-rw-r--r--source/blender/imbuf/intern/thumbs.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index e7bec7e643c..95d061bcb75 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -217,7 +217,7 @@ static bool thumbhash_from_path(const char *UNUSED(path), ThumbSource source, ch
}
}
-static int uri_from_filename(const char *path, char *uri)
+static bool uri_from_filename(const char *path, char *uri)
{
char orig_uri[URI_MAX];
const char *dirstart = path;
@@ -243,16 +243,9 @@ static int uri_from_filename(const char *path, char *uri)
#else
BLI_snprintf(orig_uri, URI_MAX, "file://%s", dirstart);
#endif
-
-#ifdef WITH_ICONV
- {
- char uri_utf8[URI_MAX];
- escape_uri_string(orig_uri, uri_utf8, URI_MAX, UNSAFE_PATH);
- BLI_string_to_utf8(uri_utf8, uri, NULL);
- }
-#else
+
escape_uri_string(orig_uri, uri, URI_MAX, UNSAFE_PATH);
-#endif
+
return 1;
}
@@ -489,7 +482,9 @@ ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, Im
char uri[URI_MAX] = "";
char thumb_name[40];
- uri_from_filename(path, uri);
+ if (!uri_from_filename(path, uri)) {
+ return NULL;
+ }
thumbname_from_uri(uri, thumb_name, sizeof(thumb_name));
return thumb_create_ex(path, uri, thumb_name, false, THUMB_DEFAULT_HASH, NULL, NULL, size, source, img);