From ead30e5bc122ba327165c752a694a0ee1abf9fbf Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Tue, 3 Mar 2009 10:24:06 +0000 Subject: 2.5 filebrowser bugfix: create directories to store thumbnails if they don't exist. --- source/blender/imbuf/IMB_thumbs.h | 3 ++- source/blender/imbuf/intern/thumbs.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/imbuf') 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) -- cgit v1.2.3