Fix DPX/CINEON writing full file paths into image headers on WIN32

Use back-slashes to find the file-name component on windows.
This commit is contained in:
Campbell Barton 2022-05-17 12:33:20 +10:00
parent 5c9ab3e003
commit 48c4c409b8
3 changed files with 8 additions and 2 deletions

View File

@ -393,7 +393,7 @@ LogImageFile *cineonCreate(
cineon->referenceBlack = 95.0f;
cineon->gamma = 1.7f;
shortFilename = strrchr(filepath, '/');
shortFilename = strrchr(filepath, PATHSEP_CHAR);
if (shortFilename == NULL) {
shortFilename = filepath;
}

View File

@ -502,7 +502,7 @@ LogImageFile *dpxCreate(const char *filepath,
dpx->gamma = 1.7f;
}
shortFilename = strrchr(filepath, '/');
shortFilename = strrchr(filepath, PATHSEP_CHAR);
if (shortFilename == NULL) {
shortFilename = filepath;
}

View File

@ -19,6 +19,12 @@
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
#ifdef _WIN32
# define PATHSEP_CHAR '\\'
#else
# define PATHSEP_CHAR '/'
#endif
#ifdef __cplusplus
extern "C" {
#endif