Skip to content
Back to skills

C2f Gd Image Safety

ASecurity

LEIA ANTES de manipular imagens com PHP GD (redimensionamento, conversão, thumbnails). Se não ler: o servidor entra em Fatal Error por falta de suporte a formatos (WebP/AVIF), esgota memória ou corrompe uploads.

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

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/badge)](https://www.skillsdirectory.com/skills/otavioserra-c2f-gd-image-safety)

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: "LEIA ANTES de manipular imagens com PHP GD (redimensionamento, conversão, thumbnails). Se não ler: o servidor entra em Fatal Error por falta de suporte a formatos (WebP/AVIF), esgota memória ou corrompe uploads."
user-invocable: false
---

# Segurança de imagens GD

# ⚡ Gatilho Obrigatório
- **TRIGGER**: Manipular upload, redimensionamento, recorte ou conversão de imagens usando a extensão GD do PHP.
- **SKIP APENAS SE**: Upload de arquivos binários não-imagem (PDFs, vídeos, áudios) tratados como arquivos estáticos puros.
- **CONSEQUÊNCIA DE IGNORAR**: Fatal Errors não capturados (`\Throwable`) em servidores sem suporte nativo a formatos específicos (WebP/AVIF) e corrupção de imagens de usuários.

---

- Antes de processar um formato, confirme `function_exists` tanto para a função de leitura quanto para a de escrita.
- Não presuma suporte WebP/AVIF a partir da presença da extensão GD; valide as funções específicas ou `gd_info()`.
- Capture `\Throwable`, não apenas `\Exception`: função GD ausente lança `\Error` e pode causar HTTP 500.
- Se o servidor não puder gerar miniatura, degrade com segurança para o arquivo original quando o navegador suportá-lo.
- Valide entrada, saída e destruição de recursos; nunca grave arquivo parcial sobre o original.
- Teste explicitamente um runtime sem suporte ao formato opcional.

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.