Repository navigation
Pad charts from a post with a white margin for social posts - #119
Merged
Merged
Conversation
…ocial posts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pad_white now saves to a separate output path, so the original stays editable and a rerun adds no second border. The skill no longer promises the margin survives every crop and asks for a preview check instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 21, 2026 13:06
Contributor
Author
|
Merged at the reviewed head 03730a2 with every check passing. Independent review: round 1 raised a P1 (transparent areas turned black), fixed in 779078b; round 2 raised a P1 (the prose overclaimed what the margin protects) and a P2 (the helper overwrote its source), fixed in 03730a2; scoped round 3 approved with no new findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a short section to the policyengine-content skill: when a social post or newsletter attaches a chart, map or table from the post, put it on a white canvas with a margin of about 6% of its width on every side. The PIL helper
pad_white(source_path, output_path)writes a padded copy, so the original stays editable and a rerun adds no second border, and it pastes through the alpha channel so transparent areas come out white. The section asks for a check of the destination's preview, since a feed's crop can still clip a wide figure.Max asked for this after the Veterans Day posts went out with charts shot flush to the figure edge.
Tests: CI passes at 03730a2 (test, manifest on Python 3.11 and 3.15, skill-examples). The snippet runs as written on transparent RGBA, opaque RGB and palette PNGs: each goes from 1,200 × 630 to 1,344 × 774 with white corners, and the source file stays unchanged.
🤖 Generated with Claude Code