From 2681e480eac0603d21174ce3bba5166dae010279 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 3 Jun 2022 19:22:57 +0200 Subject: Fix T98579: image save operators changing file path to absolute --- source/blender/blenkernel/intern/image_save.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/image_save.cc') 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); -- cgit v1.2.3