Skip to content
Back to skills

C2f Gd Image Safety

ASecurity

READ BEFORE resizing, converting or generating thumbnails with PHP GD. Prevents fatal errors from unsupported WebP/AVIF formats, memory exhaustion and corrupted uploads.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
developmentphpsecurity

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add otavioserra/conn2flow-ai-workspace --skill c2f-gd-image-safety --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C2f Gd Image Safety?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C2f Gd Image Safety
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/otavioserra-c2f-gd-image-safety-conn2flow-ai-workspace/badge)](https://www.skillsdirectory.com/skills/otavioserra-c2f-gd-image-safety-conn2flow-ai-workspace)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: c2f-gd-image-safety
description: "READ BEFORE resizing, converting or generating thumbnails with PHP GD. Prevents fatal errors from unsupported WebP/AVIF formats, memory exhaustion and corrupted uploads."
user-invocable: false
---

# GD Image Security

# ⚡ MANDATORY TRIGGER
- **TRIGGER**: Manipulate upload, resize, crop or image conversion using the PHP GD extension.
- **SKIP ONLY IF**: Upload non-image binary files (PDFs, videos, audios) treated as pure static files.
- **CONSEQUENCE OF IGNORING**: Fatal Uncaptured Errors (`\Throwable`) on servers without native support to specific formats (WebP/AVIF) and corruption of user images.

---

- Before processing a format, confirm `function_exists` for both the read and write function.
- Do not assume WebP/AVIF support from the presence of the GD extension; validate specific functions or `gd_info()`.
- Capture `\Throwable`, not only `\Exception`: missing GD function launches `\Error` and can cause HTTP 500.
- If the server cannot generate thumbnail, safely degrade to the original file when the browser supports it.
- Validate input, output and destruction of resources; never record partial file on the original.
- Explicitly test a runtime without optional format support.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.