Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-06-03 20:22:57 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-06-03 20:25:57 +0300
commit2681e480eac0603d21174ce3bba5166dae010279 (patch)
treeb7a448665696aba71733799679f17d7c3146c08c /source/blender/blenkernel/intern/image_save.cc
parentda45c12beff41aaa46b2480de80b3b941c862029 (diff)
Fix T98579: image save operators changing file path to absolute
Diffstat (limited to 'source/blender/blenkernel/intern/image_save.cc')
-rw-r--r--source/blender/blenkernel/intern/image_save.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc
index 6bfdaf9b522..9dda3762553 100644
--- a/source/blender/blenkernel/intern/image_save.cc
+++ b/source/blender/blenkernel/intern/image_save.cc
@@ -274,6 +274,12 @@ static void image_save_post(ReportList *reports,
if (opts->do_newpath) {
BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name));
BLI_strncpy(ima->filepath, filepath, sizeof(ima->filepath));
+
+ /* only image path, never ibuf */
+ if (opts->relative) {
+ const char *relbase = ID_BLEND_PATH(opts->bmain, &ima->id);
+ BLI_path_rel(ima->filepath, relbase); /* only after saving */
+ }
}
ibuf->userflags &= ~IB_BITMAPDIRTY;
@@ -303,12 +309,6 @@ static void image_save_post(ReportList *reports,
ima->type = IMA_TYPE_IMAGE;
}
- /* only image path, never ibuf */
- if (opts->relative) {
- const char *relbase = ID_BLEND_PATH(opts->bmain, &ima->id);
- BLI_path_rel(ima->filepath, relbase); /* only after saving */
- }
-
/* Update image file color space when saving to another color space. */
const bool linear_float_output = BKE_imtype_requires_linear_float(opts->im_format.imtype);