Do not allow GIF previews #57

Closed
opened 2024-03-19 12:08:27 +01:00 by Pablo Vazquez · 3 comments

Animated previews should be videos, which have better compression, playback controls.

  • Disable GIF upload (2b4bd79a34)
  • Write guidelines about animated GIF/PNG/WebP not supported
Animated previews should be videos, which have better compression, playback controls. - [x] Disable GIF upload (2b4bd79a34) - [ ] Write guidelines about animated GIF/PNG/WebP not supported
Pablo Vazquez added the
Type
Enhancement
Priority
High
labels 2024-03-19 12:08:27 +01:00
Owner

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.

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.
Anna Sirota self-assigned this 2024-04-04 12:19:44 +02:00

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.

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](https://caniuse.com/webp).
Owner

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.

I mistyped the issue number in the commit >_<, so will reference it here: https://projects.blender.org/infrastructure/extensions-website/commit/2b4bd79a34e0edcc59ee04e69a3de4312e61613e 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.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/extensions-website#57
No description provided.