ImageGenerator uses @ error suppression — silent failures on missing GD/font #49

Closed
opened 2026-06-21 14:54:42 +00:00 by jmiller · 1 comment
Owner

Problem

ImageGenerator.php uses the @ error suppression operator on all GD library function calls. If the GD extension is missing, a TTF font file is not found, or image creation fails, errors are completely silenced with no logging.

Impact

  • Debugging image generation failures is extremely difficult
  • Sites without GD get no feedback that image generation is broken
  • Missing font files produce blank/broken images with no warning

Fix

  • Replace @ suppression with proper error checking
  • Log failures via Log::add() at WARNING level
  • Return graceful fallback (null/false) when generation fails

File

  • source/packages/plg_system_mokoog/src/Helper/ImageGenerator.php
## Problem `ImageGenerator.php` uses the `@` error suppression operator on all GD library function calls. If the GD extension is missing, a TTF font file is not found, or image creation fails, errors are completely silenced with no logging. ## Impact - Debugging image generation failures is extremely difficult - Sites without GD get no feedback that image generation is broken - Missing font files produce blank/broken images with no warning ## Fix - Replace `@` suppression with proper error checking - Log failures via `Log::add()` at WARNING level - Return graceful fallback (null/false) when generation fails ## File - `source/packages/plg_system_mokoog/src/Helper/ImageGenerator.php`
jmiller added the enhancementproduction-readiness labels 2026-06-21 14:54:42 +00:00
Author
Owner

Branch created: feature/49-imagegenerator-uses-error-suppression-si

git fetch origin
git checkout feature/49-imagegenerator-uses-error-suppression-si
Branch created: [`feature/49-imagegenerator-uses-error-suppression-si`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteOpenGraph/src/branch/feature/49-imagegenerator-uses-error-suppression-si) ```bash git fetch origin git checkout feature/49-imagegenerator-uses-error-suppression-si ```
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteOpenGraph#49