aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output/paths_source.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/output/paths_source.d')
-rw-r--r--src/sdp/output/paths_source.d38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d
index 9f377bc..8f14b8e 100644
--- a/src/sdp/output/paths_source.d
+++ b/src/sdp/output/paths_source.d
@@ -295,8 +295,24 @@ template PathMatters() {
return _dir;
}
auto image_dir_path() {
- string _dir = asNormalizedPath(base_dir_path.chainPath("media/image")).array;
- return _dir;
+ string _img_pth(string _possible_img_pth) {
+ return asNormalizedPath(file_with_absolute_path.dirName ~ "/" ~ _possible_img_pth).array;
+ }
+ string _paths;
+ string[] _possible_img_pths = [ "./image", "../image", "../../image" ];
+ string _img_pth_found = "";
+ foreach(_possible_img_pth; _possible_img_pths) {
+ if (exists(_img_pth(_possible_img_pth))) {
+ _img_pth_found = _img_pth(_possible_img_pth);
+ break;
+ } else {
+ _paths ~= " " ~ _img_pth(_possible_img_pth);
+ }
+ }
+ if (_img_pth_found.empty) {
+ writeln("WARNING not image path found, searched: ", _paths);
+ }
+ return _img_pth_found;
}
auto conf_dir_path() {
auto _dir = asNormalizedPath(base_dir_path.chainPath("conf")).array;
@@ -520,24 +536,6 @@ template SiSUpathsSRC() {
auto doc_src_with_path() {
return asNormalizedPath(pwd.chainPath(_fn_src_and_path)).array;
}
- auto src_image_root_with_path() {
- string[] _possible_img_pth = [
- asNormalizedPath(pwd.chainPath((_fn_src_and_path).dirName ~ "/image")).array,
- asNormalizedPath(pwd.chainPath((_fn_src_and_path).dirName ~ "/../image")).array,
- asNormalizedPath(pwd.chainPath((_fn_src_and_path).dirName ~ "/../../image")).array,
- ];
- string _img_pth_found = "";
- foreach(_img_pth; _possible_img_pth) {
- if (exists(_img_pth)) {
- _img_pth_found = _img_pth;
- break;
- }
- }
- if (_img_pth_found.empty) {
- writeln("WARNING not image path found, searched: ", _possible_img_pth);
- }
- return _img_pth_found;
- }
}
return SisuSrcPaths();
}