diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-12-06 14:57:05 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-01-13 16:06:43 -0500 |
commit | e1cec74bdc11a3476d77b9fb5f71c8ea48e64079 (patch) | |
tree | 3f68bfaabf45c3c8afbbda52f53f840717baf0aa /src/doc_reform/meta/metadoc_from_src.d | |
parent | 0.9.2 @safe & @trusted first pass (diff) |
checks on markup: yaml headers & reading images
Diffstat (limited to 'src/doc_reform/meta/metadoc_from_src.d')
-rw-r--r-- | src/doc_reform/meta/metadoc_from_src.d | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 35d70d5..0e6c38e 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -1784,11 +1784,12 @@ template docAbstraction() { int w, h, chans; real _w, _h; int max_width = 640; - foreach (m; obj.text.matchAll(rgx.inline_image_without_dimensions)) { - debug(images) { - writeln(manifested.src.image_dir_path ~ "/" ~ m["img"]); + foreach (img; obj.text.matchAll(rgx.inline_image_without_dimensions)) { + try { + read_image_info(manifested.src.image_dir_path ~ "/" ~ img["img"], w, h, chans); // + } catch (Exception ex) { + writeln("WARNING, image not found: ", img["img"], "\n ", manifested.src.image_dir_path ~ "/" ~ img["img"]); } - read_image_info(manifested.src.image_dir_path ~ "/" ~ m["img"], w, h, chans); // calculate, decide max width and proportionally reduce to keep w & h within it debug(images) { writeln("width: ", w, ", height: ", h); |