Improve thumbnail upload; force 16:9 aspect ratio and fix overflow issues
Description
To prevent overflow and future complications, this PR implements a forced resize of images to 1280x720 pixels (16:9 ratio). If the original image is smaller than this size, black bars are added to maintain the aspect ratio. This approach aligns with YouTube's thumbnail guidelines.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
Implementation Details
- Images are resized to 1280x720 pixels (16:9 ratio)
- Black bars are added if the original image is smaller than 1280x720
- This change addresses overflow issues and potential future complications
Future Work
Further in-depth work on this feature will be addressed in issue #868
Reference
The approach taken is based on YouTube's guidelines:
- Make your thumbnail 1280 by 720 pixels (16:9 ratio)
- Ensure that your thumbnail is less than 2MB
- Use a JPG, PNG, or GIF file format
Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| streameth-platform | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 26, 2024 1:36pm |
Just noticing that uploading a thumbnail does not actually work before uploading a video
Found an new error in the tests. Will create an issue of it for another PR