diff options
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_thumbs.h | 3 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 10 |
3 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 48f501f0173..dfa353cc6e4 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -36,6 +36,8 @@ #include "MEM_guardedalloc.h" +#include "BIF_gl.h" + #include "BLO_readfile.h" #include "BLI_blenlib.h" @@ -50,7 +52,8 @@ #include "ED_screen.h" #include "ED_fileselect.h" -#include "BIF_gl.h" +#include "IMB_imbuf_types.h" +#include "IMB_thumbs.h" #include "WM_api.h" #include "WM_types.h" @@ -414,6 +417,7 @@ void ED_file_init(void) BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); fsmenu_read_file(name); filelist_init_icons(); + IMB_thumb_makedirs(); } void ED_file_exit(void) 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) |