diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-08-27 13:32:35 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-08-28 10:04:05 -0400 |
| commit | 714b25c433bf41e798f98cc7a41026c405c23115 (patch) | |
| tree | 568d9cac782a8016afddd2d26d0f94fdca3e8a15 | |
| parent | image digest: single read, cache file read & hash (diff) | |
has.images: set flag but was not assigned, fix
every object with an .image record should now carry the images
flag.
Previously DocObj_Has_.images was read but never written anywhere
in the tree, so no object carried it: .ssp emitted has_images = 0
for every object of every document.
(assisted by Claude-Code)
| -rw-r--r-- | org/ocda.org | 1 | ||||
| -rw-r--r-- | org/ocda_functions.org | 17 | ||||
| -rw-r--r-- | org/ocda_obj_setter.org | 2 | ||||
| -rw-r--r-- | src/sisudoc/ocda/meta/metadoc_from_src.d | 1 | ||||
| -rw-r--r-- | src/sisudoc/ocda/meta/metadoc_from_src_functions.d | 17 | ||||
| -rw-r--r-- | src/sisudoc/ocda/meta/metadoc_object_setter.d | 2 |
6 files changed, 40 insertions, 0 deletions
diff --git a/org/ocda.org b/org/ocda.org index 0ae0309..f84d522 100644 --- a/org/ocda.org +++ b/org/ocda.org @@ -867,6 +867,7 @@ _loopMarkupSrcByLineStruct loopMarkupSrcByLine( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; comp_obj_.has.image_without_dimensions = substantive_obj_misc_struct.has_images_without_dimensions; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); diff --git a/org/ocda_functions.org b/org/ocda_functions.org index 0e42cfb..5cc5e1a 100644 --- a/org/ocda_functions.org +++ b/org/ocda_functions.org @@ -1169,6 +1169,7 @@ ST_flow_table_array_munge flow_table_array_munge()( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); pith["block_is"] = eN.blk_is.quote; @@ -1215,6 +1216,7 @@ ST_flow_table_array_munge flow_table_array_munge()( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); pith["block_is"] = eN.blk_is.poem; @@ -1261,6 +1263,7 @@ ST_flow_table_array_munge flow_table_array_munge()( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; pith["block_is"] = eN.blk_is.block; pith["block_state"] = eN.blk_state.off; @@ -1339,6 +1342,7 @@ ST_flow_table_array_munge flow_table_array_munge()( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; pith["block_is"] = eN.blk_is.code; pith["block_state"] = eN.blk_state.off; @@ -1830,6 +1834,7 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); } @@ -1886,6 +1891,7 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -1918,6 +1924,7 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_number_poem["end"] = obj_cite_digits.object_number.to!string; @@ -1974,6 +1981,7 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -2006,6 +2014,7 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_number_poem["end"] = obj_cite_digits.object_number.to!string; @@ -2062,6 +2071,7 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -2585,6 +2595,7 @@ static struct ObjInlineMarkupMunge { ) { obj_txt_out = ""; bool urls = false; + bool images_present = false; bool images_without_dimensions = false; tail = ""; // special endnotes @@ -2599,6 +2610,7 @@ static struct ObjInlineMarkupMunge { ); // image matched if (obj_txt_in.match(rgx.smid_image_generic)) { + images_present = true; obj_txt_in = images(obj_txt_in); if (obj_txt_in.match(rgx.smid_mod_image_without_dimensions)) { images_without_dimensions = true; @@ -2630,6 +2642,7 @@ static struct ObjInlineMarkupMunge { ret.has_notes_star = ftn.has_notes_star; ret.has_notes_plus = ftn.has_notes_plus; ret.has_urls = urls; + ret.has_images = images_present; ret.has_images_without_dimensions = images_without_dimensions; } return ret; @@ -2645,6 +2658,7 @@ static struct ObjInlineMarkupMunge { ret.has_notes_star = false; ret.has_notes_plus = false; ret.has_urls = false; + ret.has_images = false; ret.has_images_without_dimensions = false; } return ret; @@ -2759,6 +2773,7 @@ static struct ObjInlineMarkup { ret.has_notes_star = false; ret.has_notes_plus = false; ret.has_links = false; + ret.has_images = false; ret.has_images_without_dimensions = false; if ((obj_["is"] == "para") || (obj_["is"] == "heading") @@ -2819,6 +2834,7 @@ static struct ObjInlineMarkup { ret.has_notes_star = x.has_notes_star; ret.has_notes_plus = x.has_notes_plus; ret.has_links = x.has_urls; + ret.has_images = x.has_images; ret.has_images_without_dimensions = x.has_images_without_dimensions; break; } @@ -4851,6 +4867,7 @@ struct NodeStructureMetadata { comp_obj_.has.inline_notes_reg = substantive_object_and_anchor_tags_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_object_and_anchor_tags_struct.has_notes_star; comp_obj_.has.inline_links = substantive_object_and_anchor_tags_struct.has_links; + comp_obj_.has.images = substantive_object_and_anchor_tags_struct.has_images; tag_assoc[comp_obj_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_.tags.in_segment_html; tag_assoc[comp_obj_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_.tags.segment_anchor_tag_epub; debug(_node) { diff --git a/org/ocda_obj_setter.org b/org/ocda_obj_setter.org index f16e133..9cc9598 100644 --- a/org/ocda_obj_setter.org +++ b/org/ocda_obj_setter.org @@ -271,6 +271,7 @@ struct ST_txtPlusHasFootnotesUrlsImages { bool has_notes_star; bool has_notes_plus; bool has_urls; + bool has_images; bool has_images_without_dimensions; } struct ST_txtAndAnchorTagPlusHasFootnotesUrlsImages { @@ -280,6 +281,7 @@ struct ST_txtAndAnchorTagPlusHasFootnotesUrlsImages { bool has_notes_star; bool has_notes_plus; bool has_links; // use same name + bool has_images; bool has_images_without_dimensions; } struct ST_the_section { diff --git a/src/sisudoc/ocda/meta/metadoc_from_src.d b/src/sisudoc/ocda/meta/metadoc_from_src.d index dcdc239..cae6c25 100644 --- a/src/sisudoc/ocda/meta/metadoc_from_src.d +++ b/src/sisudoc/ocda/meta/metadoc_from_src.d @@ -768,6 +768,7 @@ template docAbstraction() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; comp_obj_.has.image_without_dimensions = substantive_obj_misc_struct.has_images_without_dimensions; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); diff --git a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d index cc79a67..1bc1e81 100644 --- a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d +++ b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d @@ -713,6 +713,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); } @@ -769,6 +770,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -801,6 +803,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_number_poem["end"] = obj_cite_digits.object_number.to!string; @@ -857,6 +860,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -889,6 +893,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_number_poem["end"] = obj_cite_digits.object_number.to!string; @@ -945,6 +950,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -1992,6 +1998,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); pith["block_is"] = eN.blk_is.quote; @@ -2038,6 +2045,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); pith["block_is"] = eN.blk_is.poem; @@ -2084,6 +2092,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; pith["block_is"] = eN.blk_is.block; pith["block_state"] = eN.blk_state.off; @@ -2162,6 +2171,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; pith["block_is"] = eN.blk_is.code; pith["block_state"] = eN.blk_state.off; @@ -2402,6 +2412,7 @@ template docAbstractionFunctions() { ) { obj_txt_out = ""; bool urls = false; + bool images_present = false; bool images_without_dimensions = false; tail = ""; // special endnotes @@ -2416,6 +2427,7 @@ template docAbstractionFunctions() { ); // image matched if (obj_txt_in.match(rgx.smid_image_generic)) { + images_present = true; obj_txt_in = images(obj_txt_in); if (obj_txt_in.match(rgx.smid_mod_image_without_dimensions)) { images_without_dimensions = true; @@ -2447,6 +2459,7 @@ template docAbstractionFunctions() { ret.has_notes_star = ftn.has_notes_star; ret.has_notes_plus = ftn.has_notes_plus; ret.has_urls = urls; + ret.has_images = images_present; ret.has_images_without_dimensions = images_without_dimensions; } return ret; @@ -2462,6 +2475,7 @@ template docAbstractionFunctions() { ret.has_notes_star = false; ret.has_notes_plus = false; ret.has_urls = false; + ret.has_images = false; ret.has_images_without_dimensions = false; } return ret; @@ -2569,6 +2583,7 @@ template docAbstractionFunctions() { ret.has_notes_star = false; ret.has_notes_plus = false; ret.has_links = false; + ret.has_images = false; ret.has_images_without_dimensions = false; if ((obj_["is"] == "para") || (obj_["is"] == "heading") @@ -2629,6 +2644,7 @@ template docAbstractionFunctions() { ret.has_notes_star = x.has_notes_star; ret.has_notes_plus = x.has_notes_plus; ret.has_links = x.has_urls; + ret.has_images = x.has_images; ret.has_images_without_dimensions = x.has_images_without_dimensions; break; } @@ -4623,6 +4639,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_object_and_anchor_tags_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_object_and_anchor_tags_struct.has_notes_star; comp_obj_.has.inline_links = substantive_object_and_anchor_tags_struct.has_links; + comp_obj_.has.images = substantive_object_and_anchor_tags_struct.has_images; tag_assoc[comp_obj_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_.tags.in_segment_html; tag_assoc[comp_obj_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_.tags.segment_anchor_tag_epub; debug(_node) { diff --git a/src/sisudoc/ocda/meta/metadoc_object_setter.d b/src/sisudoc/ocda/meta/metadoc_object_setter.d index a88f491..9fcc2b9 100644 --- a/src/sisudoc/ocda/meta/metadoc_object_setter.d +++ b/src/sisudoc/ocda/meta/metadoc_object_setter.d @@ -260,6 +260,7 @@ template ObjectSetter() { bool has_notes_star; bool has_notes_plus; bool has_urls; + bool has_images; bool has_images_without_dimensions; } struct ST_txtAndAnchorTagPlusHasFootnotesUrlsImages { @@ -269,6 +270,7 @@ template ObjectSetter() { bool has_notes_star; bool has_notes_plus; bool has_links; // use same name + bool has_images; bool has_images_without_dimensions; } struct ST_the_section { |
