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:
authorAndrea Weikert <elubie@gmx.net>2009-03-03 13:24:06 +0300
committerAndrea Weikert <elubie@gmx.net>2009-03-03 13:24:06 +0300
commitead30e5bc122ba327165c752a694a0ee1abf9fbf (patch)
treebd73555ae3dbb72f1a19f926913d40027f457368 /source/blender/imbuf
parent981dde56b4f76e198172b6636c6ea1b5f657f92d (diff)
2.5 filebrowser
bugfix: create directories to store thumbnails if they don't exist.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/IMB_thumbs.h3
-rw-r--r--source/blender/imbuf/intern/thumbs.c10
2 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index 4f4b77ff000..53b63b4d304 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -67,7 +67,8 @@ void IMB_thumb_delete(const char* dir, const char* file, ThumbSize size);
/* return the state of the thumb, needed to determine how to manage the thumb */
ImBuf* IMB_thumb_manage(const char* dir, const char* file, ThumbSize size, ThumbSource source);
-
+/* create the necessary dirs to store the thumbnails */
+void IMB_thumb_makedirs();
#endif /* _IMB_THUMBS_H */
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 14d6cb2d54b..86ca43824f3 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -232,6 +232,16 @@ static int thumbpath_from_uri(const char* uri, char* path, ThumbSize size)
return rv;
}
+void IMB_thumb_makedirs()
+{
+ char tpath[FILE_MAX];
+ if (get_thumb_dir(tpath, THB_NORMAL)) {
+ BLI_recurdir_fileops(tpath);
+ }
+ if (get_thumb_dir(tpath, THB_FAIL)) {
+ BLI_recurdir_fileops(tpath);
+ }
+}
/* create thumbnail for file and returns new imbuf for thumbnail */
ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, ThumbSource source)