feat: social image generator with GD text overlay #213

Merged
jmiller merged 2 commits from feature/157-social-image-generator into dev 2026-06-29 11:34:20 +00:00

2 Commits

Author SHA1 Message Date
jmiller 437189830f feat: add social image generator with GD text overlay (#157)
Universal: PR Check / Branch Policy (pull_request) Successful in 3s
Universal: PR Check / Validate PR (pull_request) Failing after 7s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 3s
Universal: PR Check / Secret Scan (pull_request) Successful in 9s
Universal: Auto Version Bump / Version Bump (push) Successful in 18s
Generic: Project CI / Lint & Validate (pull_request) Successful in 27s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 43s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Replace complex multi-platform compositing with simpler spec-compliant
implementation:
- SocialImageHelper: 1200x630 OG images with solid background, title
  overlay using TTF fonts (or GD fallback), and site name watermark
- SocialImageController: AJAX endpoint with CSRF + ACL checks
- Config: enabled toggle, bg/text color, font size, show site name
- Content plugin: Generate Social Image button in Share Content panel
- Saves to media/com_mokosuitecross/social/ with SHA-256 filename

Authored-by: Moko Consulting
2026-06-29 06:33:17 -05:00
jmiller 1aa58e1d8d feat: add social image generator with GD-based OG image compositing (#157)
Replace basic single-size OG image generation with full-featured
multi-platform social image compositing:

- Platform-specific canvas sizes: Facebook 1200x630, Twitter 1200x675,
  Instagram 1080x1080, Stories 1080x1920
- Vertical linear gradient fallback when no source image available
- Semi-transparent overlay with configurable color and opacity (0-100%)
- Logo placement in top-right corner, auto-scaled to 15% of canvas width
- TTF text rendering with word wrap and text shadow for readability
- GD bitmap font fallback when no TTF fonts are available
- Configurable text position: top, center, or bottom
- Output to images/mokosuitecross/{articleId}_{platform}.jpg
- Cache clearing per article via clearCache() method
- ImageController AJAX endpoint with platform parameter validation
- Full config fieldset: enabled toggle, overlay color/opacity,
  text color/position, gradient start/end, logo upload

Authored-by: Moko Consulting
2026-06-29 06:32:18 -05:00