Skip to content

fix: process alphaModFix for images#3691

Merged
luccas-harbour merged 3 commits into
mainfrom
sd-3243_alphaModFix
Jun 10, 2026
Merged

fix: process alphaModFix for images#3691
luccas-harbour merged 3 commits into
mainfrom
sd-3243_alphaModFix

Conversation

@VladaHarbour

Copy link
Copy Markdown
Contributor

No description provided.

@VladaHarbour VladaHarbour self-assigned this Jun 9, 2026
@VladaHarbour VladaHarbour requested a review from a team as a code owner June 9, 2026 18:18
@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

SD-3243

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The ecma-spec MCP tools are installed but every call is being rejected with "haven't granted it yet" — the permission prompt isn't resolving in this session, so I couldn't run live schema lookups. I'll flag that, and give you the review based on the ECMA-376 DrawingML schema for this element (which is unambiguous here).


Status: PASS

The change parses a:alphaModFix out of the a:blip element and stores its amt attribute. That's all spec-correct:

  • a:alphaModFix is a real DrawingML element (CT_AlphaModulateFixedEffect, namespace …/drawingml/2006/main) and is a legal child of a:blip (CT_Blip), alongside the other blip effects like a:lum, a:grayscl, a:biLevel, etc. The handler reads it via findChildByLocalName(blip?.elements, 'alphaModFix'), which matches where the spec places it. ✓ — https://ooxml.dev/spec?q=alphaModFix
  • amt is the correct (and only) attribute on that element. Its type is ST_PositiveFixedPercentage, range 0..100000 where 100000 = 100%, and it's optional with a default of 100000 (fully opaque). ✓
  • Default handling is right. Because the spec default is 100% opaque, resolveImageOpacity returning null when the computed opacity is 1 (and the converter omitting alphaModFix when absent) correctly treats "no alphaModFix" and "amt=100000" as no-op. No incorrect default baked in. ✓
  • No missing required attributesamt is optional, and extractAlphaModFix correctly returns undefined when it's absent or non-finite rather than fabricating a value.
  • Unit math matches the spec range9000 / 100000 = 0.09, and the painter clamps to [0, 100000] before dividing, consistent with ST_PositiveFixedPercentage.

No non-existent elements/attributes, no spec violations in the two changed files (encode-image-node-helpers.js and its test). The accompanying contract/adapter/painter changes carry the same {amt} shape through faithfully.

One non-spec note (not a compliance issue): the converter doesn't clamp amt to the 0..100000 range — a malformed file with amt="250000" would pass through, but the painter clamps at paint time, so output stays valid. Fine as-is.

If you want the live MCP verification on record, re-run once the ecma-spec tool permissions are granted and I'll confirm CT_AlphaModulateFixedEffect/amt against the parsed XSD directly.

@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: 7e5765f120

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@missysuperdoc missysuperdoc requested review from luccas-harbour and removed request for caio-pizzol and harbournick June 10, 2026 13:25
Comment thread packages/layout-engine/painters/dom/src/images/drawing-image.ts Outdated
@luccas-harbour

Copy link
Copy Markdown
Contributor

hey @VladaHarbour! it's all looking good here. Claude/codex found a few things that I left as inline comments.
I noticed that there's a unit test that's failing but it doesn't seem to be related to your changes, perhaps merging the latest changes from main into this branch might fix it?

also, not sure if you did this already but it would be good to upload the test document to the corpus (with pnpm corpus:upload) to lock this fix.

@VladaHarbour VladaHarbour force-pushed the sd-3243_alphaModFix branch from 0d11689 to 12a8b7f Compare June 10, 2026 16:30

@luccas-harbour luccas-harbour left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@luccas-harbour luccas-harbour merged commit 77bdfe6 into main Jun 10, 2026
69 checks passed
@luccas-harbour luccas-harbour deleted the sd-3243_alphaModFix branch June 10, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants