Do not allow GIF previews #57
Labels
No Label
Priority
Critical
Priority
High
Priority
Low
Priority
Normal
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Type
Breaking
Type
Documentation
Type
Enhancement
Type
Feature
Type
Report
Type
Security
Type
Suggestion
Type
Testing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/extensions-website#57
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Animated previews should be videos, which have better compression, playback controls.
2b4bd79a34
)While looking into this noticed that TIFFs are allowed as well, so will assume for now that we only want to allow JPG and PNG for images, and MP4 for videos.
WEBP is my preferred format for web images, and what most image optimizers default to. The same or better compression as JPG, transparency supported, and works in all browsers.
I mistyped the issue number in the commit >_<, so will reference it here:
2b4bd79a34
This commit changes the preview upload form to filter everything except JPEG, PNG, WebP and MP4, and adds server-side checks based on file extension and
libmagic
expecting the same formats.This effectively disables GIF uploads, but not animated PNG or WebP, because
libmagic
doesn't distinguish between animated and single-image ones, from what I can tell. If this becomes a problem in the future, we could use something else (PIL? our own way to guess by magic bytes?) to identify them though, but for now I left it as is.