diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-17 17:18:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-17 17:18:15 +0300 |
commit | 56173e512cab020a5bc96e6d3069641a03d47fbe (patch) | |
tree | 112fcb93a1898fadb34c2b74ae32471a6364a969 /source/blender/blenkernel/intern | |
parent | 6855d537e3112f7ba4d84524d06a524b0ea9f7b1 (diff) | |
parent | a0a1fc89387f0f1396b5e4320c2dd4a6fedd1c25 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/cachefile.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 44 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/studiolight.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeavi.c | 2 |
4 files changed, 25 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c index 74c0dca6279..c7d7a3a98eb 100644 --- a/source/blender/blenkernel/intern/cachefile.c +++ b/source/blender/blenkernel/intern/cachefile.c @@ -217,7 +217,7 @@ bool BKE_cachefile_filepath_get( char ext[32]; BLI_path_frame_strip(r_filepath, true, ext); BLI_path_frame(r_filepath, frame, frame_len); - BLI_ensure_extension(r_filepath, FILE_MAX, ext); + BLI_path_extension_ensure(r_filepath, FILE_MAX, ext); /* TODO(kevin): store sequence range? */ return BLI_exists(r_filepath); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d165c6dddc9..fc6530a2ca7 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -576,7 +576,7 @@ static void image_init_color_management(Image *ima) char BKE_image_alpha_mode_from_extension_ex(const char *filepath) { - if (BLI_testextensie_n(filepath, ".exr", ".cin", ".dpx", ".hdr", NULL)) { + if (BLI_path_extension_check_n(filepath, ".exr", ".cin", ".dpx", ".hdr", NULL)) { return IMA_ALPHA_PREMUL; } else { @@ -607,7 +607,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath) ima = image_alloc(bmain, BLI_path_basename(filepath), IMA_SRC_FILE, IMA_TYPE_IMAGE); STRNCPY(ima->name, filepath); - if (BLI_testextensie_array(filepath, imb_ext_movie)) + if (BLI_path_extension_check_array(filepath, imb_ext_movie)) ima->source = IMA_SRC_MOVIE; image_init_color_management(ima); @@ -1352,63 +1352,63 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF (void)im_format; /* may be unused, depends on build options */ if (imtype == R_IMF_IMTYPE_IRIS) { - if (!BLI_testextensie(string, extension_test = ".rgb")) + if (!BLI_path_extension_check(string, extension_test = ".rgb")) extension = extension_test; } else if (imtype == R_IMF_IMTYPE_IRIZ) { - if (!BLI_testextensie(string, extension_test = ".rgb")) + if (!BLI_path_extension_check(string, extension_test = ".rgb")) extension = extension_test; } #ifdef WITH_HDR else if (imtype == R_IMF_IMTYPE_RADHDR) { - if (!BLI_testextensie(string, extension_test = ".hdr")) + if (!BLI_path_extension_check(string, extension_test = ".hdr")) extension = extension_test; } #endif else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) { - if (!BLI_testextensie(string, extension_test = ".png")) + if (!BLI_path_extension_check(string, extension_test = ".png")) extension = extension_test; } #ifdef WITH_DDS else if (imtype == R_IMF_IMTYPE_DDS) { - if (!BLI_testextensie(string, extension_test = ".dds")) + if (!BLI_path_extension_check(string, extension_test = ".dds")) extension = extension_test; } #endif else if (ELEM(imtype, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_RAWTGA)) { - if (!BLI_testextensie(string, extension_test = ".tga")) + if (!BLI_path_extension_check(string, extension_test = ".tga")) extension = extension_test; } else if (imtype == R_IMF_IMTYPE_BMP) { - if (!BLI_testextensie(string, extension_test = ".bmp")) + if (!BLI_path_extension_check(string, extension_test = ".bmp")) extension = extension_test; } #ifdef WITH_TIFF else if (imtype == R_IMF_IMTYPE_TIFF) { - if (!BLI_testextensie_n(string, extension_test = ".tif", ".tiff", NULL)) { + if (!BLI_path_extension_check_n(string, extension_test = ".tif", ".tiff", NULL)) { extension = extension_test; } } #endif #ifdef WITH_OPENIMAGEIO else if (imtype == R_IMF_IMTYPE_PSD) { - if (!BLI_testextensie(string, extension_test = ".psd")) + if (!BLI_path_extension_check(string, extension_test = ".psd")) extension = extension_test; } #endif #ifdef WITH_OPENEXR else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == R_IMF_IMTYPE_MULTILAYER) { - if (!BLI_testextensie(string, extension_test = ".exr")) + if (!BLI_path_extension_check(string, extension_test = ".exr")) extension = extension_test; } #endif #ifdef WITH_CINEON else if (imtype == R_IMF_IMTYPE_CINEON) { - if (!BLI_testextensie(string, extension_test = ".cin")) + if (!BLI_path_extension_check(string, extension_test = ".cin")) extension = extension_test; } else if (imtype == R_IMF_IMTYPE_DPX) { - if (!BLI_testextensie(string, extension_test = ".dpx")) + if (!BLI_path_extension_check(string, extension_test = ".dpx")) extension = extension_test; } #endif @@ -1416,35 +1416,35 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF else if (imtype == R_IMF_IMTYPE_JP2) { if (im_format) { if (im_format->jp2_codec == R_IMF_JP2_CODEC_JP2) { - if (!BLI_testextensie(string, extension_test = ".jp2")) + if (!BLI_path_extension_check(string, extension_test = ".jp2")) extension = extension_test; } else if (im_format->jp2_codec == R_IMF_JP2_CODEC_J2K) { - if (!BLI_testextensie(string, extension_test = ".j2c")) + if (!BLI_path_extension_check(string, extension_test = ".j2c")) extension = extension_test; } else BLI_assert(!"Unsupported jp2 codec was specified in im_format->jp2_codec"); } else { - if (!BLI_testextensie(string, extension_test = ".jp2")) + if (!BLI_path_extension_check(string, extension_test = ".jp2")) extension = extension_test; } } #endif else { // R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90 etc - if (!(BLI_testextensie_n(string, extension_test = ".jpg", ".jpeg", NULL))) + if (!(BLI_path_extension_check_n(string, extension_test = ".jpg", ".jpeg", NULL))) extension = extension_test; } if (extension) { /* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */ /* remove any other known image extension */ - if (BLI_testextensie_array(string, imb_ext_image)) { - return BLI_replace_extension(string, FILE_MAX, extension); + if (BLI_path_extension_check_array(string, imb_ext_image)) { + return BLI_path_extension_replace(string, FILE_MAX, extension); } else { - return BLI_ensure_extension(string, FILE_MAX, extension); + return BLI_path_extension_ensure(string, FILE_MAX, extension); } } @@ -3028,7 +3028,7 @@ bool BKE_image_is_openexr(struct Image *ima) { #ifdef WITH_OPENEXR if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) { - return BLI_testextensie(ima->name, ".exr"); + return BLI_path_extension_check(ima->name, ".exr"); } #else UNUSED_VARS(ima); diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 297993ae3e4..b116e99e63b 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -549,7 +549,7 @@ static void studiolight_add_files_from_datafolder(const int folder_id, const cha if ((dir[i].type & S_IFREG)) { const char *filename = dir[i].relname; const char *path = dir[i].path; - if (BLI_testextensie_array(filename, imb_ext_image)) { + if (BLI_path_extension_check_array(filename, imb_ext_image)) { sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | flag); BLI_strncpy(sl->name, filename, FILE_MAXFILE); BLI_strncpy(sl->path, path, FILE_MAXFILE); diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 33ac312425b..2c6b22f0402 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -150,7 +150,7 @@ static void filepath_avi(char *string, RenderData *rd, bool preview, const char BLI_make_existing_file(string); if (rd->scemode & R_EXTENSION) { - if (!BLI_testextensie(string, ".avi")) { + if (!BLI_path_extension_check(string, ".avi")) { BLI_path_frame_range(string, sfra, efra, 4); strcat(string, ".avi"); } |