[Bf-blender-cvs] [48c4c409b83] master: Fix DPX/CINEON writing full file paths into image headers on WIN32

Campbell Barton noreply at git.blender.org
Tue May 17 05:13:27 CEST 2022


Commit: 48c4c409b83c6ab8c00b64efb087cf0eb9bb8597
Author: Campbell Barton
Date:   Tue May 17 12:33:20 2022 +1000
Branches: master
https://developer.blender.org/rB48c4c409b83c6ab8c00b64efb087cf0eb9bb8597

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

Use back-slashes to find the file-name component on windows.

===================================================================

M	source/blender/imbuf/intern/cineon/cineonlib.c
M	source/blender/imbuf/intern/cineon/dpxlib.c
M	source/blender/imbuf/intern/cineon/logImageCore.h

===================================================================

diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c
index 2f00a64a2cf..8312476bda0 100644
--- a/source/blender/imbuf/intern/cineon/cineonlib.c
+++ b/source/blender/imbuf/intern/cineon/cineonlib.c
@@ -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;
   }
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c
index 9fbc118913d..28c19116361 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.c
+++ b/source/blender/imbuf/intern/cineon/dpxlib.c
@@ -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;
   }
diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h
index 8366927a95b..35540497828 100644
--- a/source/blender/imbuf/intern/cineon/logImageCore.h
+++ b/source/blender/imbuf/intern/cineon/logImageCore.h
@@ -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



More information about the Bf-blender-cvs mailing list