Skip to content

Disallow GIF image uploads - #336

Merged
nunomaduro merged 3 commits into
dev-null-sh:productionfrom
xHeaven:fix/disallow-gif-uploads
Oct 17, 2026
Merged

nunomaduro merged 3 commits into
dev-null-sh:productionfrom
xHeaven:fix/disallow-gif-uploads

Conversation

@xHeaven

@xHeaven xHeaven commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Problem

GIFs could be attached to commits and replies, but every upload is decoded and re-encoded as a single-frame WebP, so animated GIFs ended up as a still of their first frame. Accepting them only produced a misleading result.

Behavior

  • GIFs are no longer accepted as commit or reply images.
  • The image picker no longer offers GIFs in the file dialog. GIFs that are picked, dropped or pasted are left out, with the message "Only JPEG, PNG, or WebP images up to 10 MB."
  • The server refuses GIFs in both the form request (File::types, also used for scheduled commits) and CreateCommitImageFiles, so a GIF that bypasses the client gets a validation error.
  • Images already stored are WebP, so existing commits are not affected. A GIF saved in a local draft stash before this change is dropped when that draft is restored, because restoring uses the same pickImages filter.

Validation

  • vendor/bin/pest tests/Unit/Actions/CreateCommitImagesTest.php tests/Feature/Controllers/CommitControllerTest.php tests/Feature/Controllers/CommitReplyControllerTest.php (196 passed). New GIF cases failed before the change.
  • bun run test:types, vp fmt --check and vp lint on the touched file, pint --dirty.

No media: the change only removes GIF from the accepted types and updates the error copy.

@nunomaduro
nunomaduro merged commit e95a3be into dev-null-sh:production Oct 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants