Skip to content

Skip unsupported Noise gradients in overlays, strokes, and fills - #481

Merged
shimoda-uec merged 2 commits into
CyberAgent:mainfrom
shimoda-uec:fix/462-noise-gradient-overlay
Oct 16, 2026
Merged

shimoda-uec merged 2 commits into
CyberAgent:mainfrom
shimoda-uec:fix/462-noise-gradient-overlay

Conversation

@shimoda-uec

@shimoda-uec shimoda-uec commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Skip unsupported Noise gradients with a warning across gradient overlays, Stroke effects, gradient fill layers, and shape-layer gradient fills instead of raising KeyError: b'Clrs'.
  • Leave unsupported fills unpainted and skip unsupported Stroke effects while continuing conversion of the rest of the PSD.
  • Add regression coverage using the 64×64 Photoshop PSD attached to [Bug]: Noise gradient overlay raises KeyError: b'Clrs' #462 and Noise descriptors applied to existing stroke and fill fixtures.

Verification

  • PYTHONPATH=src pytest -q tests/test_effects.py tests/test_paint.py tests/test_gradient.py (27 passed)
  • ruff check and ruff format --check passed for changed Python files.
  • Targeted mypy reports three existing composite_overlay_fill argument-type errors; no new errors.
  • A local full pytest -q run was stopped after 852 passed, 65 failed. Failures included blend-mode and browser/rasterizer tests in this environment; the earlier PR run also reproduced blend-mode failures on clean main. All PR CI checks passed on this update, including Linux and Windows test jobs.

Fixture provenance

The PSD is the noise_gradient.psd attached to #462 by its reporter. The issue describes it as authored in Adobe Photoshop; the Photoshop version was not provided. It is 27 KB and contains a single Noise gradient overlay reproduction.

AI assistance

OpenAI Codex (GPT-6) drafted the code change, regression tests, and this PR description. The Noise gradient descriptor and conversion behavior were checked against the attached PSD and existing stroke and fill fixtures.

Fixes #462

Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:07

Copilot AI 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.

🟡 Changes recommended

The changelog references issue #462 instead of the pull request number required by repository conventions.

1 open finding
What changed in this PR

Skips unsupported Noise gradient overlays instead of aborting PSD conversion.

Changes:

  • Detects Noise gradients and logs a warning.
  • Adds a regression fixture and conversion test.
  • Documents the fix in the changelog.
File Description
src/​psd2svg/​core/​effects.py Skips Noise gradient overlays safely.
tests/​test_effects.py Verifies successful conversion and warning behavior.
tests/​fixtures/​effects/​noise-gradient-overlay.psd Provides the regression input.
CHANGELOG.md Records the user-facing fix.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md Outdated
@shimoda-uec
shimoda-uec requested a review from kyamagu October 16, 2026 05:30

@kyamagu kyamagu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The overlay guard works and the regression test covers it, but the same KeyError: b'Clrs' can still be raised from other gradient consumers. See the inline comments.

Comment thread src/psd2svg/core/effects.py Outdated
Comment thread tests/test_effects.py
Comment thread CHANGELOG.md Outdated
@shimoda-uec shimoda-uec changed the title Skip unsupported Noise gradient overlays Skip unsupported Noise gradients in overlays, strokes, and fills Oct 16, 2026
@shimoda-uec
shimoda-uec merged commit d17cc6c into CyberAgent:main Oct 16, 2026
12 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.

[Bug]: Noise gradient overlay raises KeyError: b'Clrs'

3 participants