Skip to content

Add image scaling support - #71

Merged
svetlyak40wt merged 2 commits into
masterfrom
feat/DOC-IMAGE-SCALE-001
Sep 5, 2026
Merged

svetlyak40wt merged 2 commits into
masterfrom
feat/DOC-IMAGE-SCALE-001

Conversation

@svetlyak40wt

@svetlyak40wt svetlyak40wt commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace defasset with the breaking defimage API.
  • Support positive :width and :height pixel values; only dimensions explicitly supplied by the author are emitted.
  • Emit a sized HTML img element for Markdown when dimensions are requested; scale the project logo to 256px.

Validation

  • asdf:test-system "40ants-doc-test"
  • Documentation build with warnings treated as errors
  • 40ants-linter --system "40ants-doc, 40ants-doc-full, 40ants-doc-test" --imports

Closes #43.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T09:12:45.944448Z faa0223 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faa0223e55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread full/commondoc/image.lisp Outdated
Comment on lines +260 to +262
(if width
(values width (round (* width source-height) source-width))
(values (round (* height source-width) source-height) height))))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clamp inferred dimensions to a positive pixel count

When a strongly non-square image is scaled to a small size, round can infer zero: for example, a 2×1 source declared with :width 1 produces height="0", collapsing the rendered image despite the API's positive-pixel contract. Clamp the inferred side to at least 1 and add a non-square downscaling regression test.

AGENTS.md reference: AGENTS.md:L43-L43

Useful? React with 👍 / 👎.

Comment thread full/commondoc/image.lisp
Comment on lines +378 to +380
(format stream "<img src=\"~A\" alt=\"~A\"~@[ width=\"~A\"~]~@[ height=\"~A\"~]>"
(image-source obj)
(common-doc:description obj)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Escape attributes in sized Markdown image HTML

When a sized image has a description containing HTML attribute characters, such as :description "A \"large\" diagram", this direct format inserts the value unescaped and emits malformed raw HTML; crafted descriptions can also introduce extra attributes. Escape both the generated source URL and alt text as HTML attribute values before emitting the sized Markdown image, and cover special-character descriptions.

AGENTS.md reference: AGENTS.md:L43-L43

Useful? React with 👍 / 👎.

@svetlyak40wt
svetlyak40wt merged commit 1286889 into master Sep 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to define assets such as images

1 participant