OpenCut-app / OpenCut-app/OpenCut

[FEATURE] File Size Validation

Đang mở
#653 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

enhancement
Ngôn ngữ chính
TypeScript
Star
89.9k
Fork
8.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Problem

No validation for file sizes before uploading. Large files can cause browser crashes or storage issues.
Users can accidentally upload huge files, causing performance problems.

Solution

Pre-upload Validation with Hard Limits

  • Validate file size before processing starts
  • Reject files exceeding configured limits immediately
  • Show clear error messages with file size info
  • Different limits for images, videos, and audio
  • Pros: Simple, prevents issues early
  • Cons: May be too restrictive for some use cases
Alternative

Approach 1: Soft Limits with Warnings

  • Allow uploads but show warnings for large files
  • Provide "Continue anyway" option
  • Track large files separately
  • Pros: Flexible, user-friendly
  • Cons: Users might ignore warnings

Approach 2: Progressive Upload with Chunking

  • Split large files into chunks
  • Upload chunks progressively
  • Validate chunk size
  • Pros: Handles very large files, better UX
  • Cons: Complex implementation, requires chunking logic
Implementation Details:
  • Add file size limits (configurable, with sensible defaults)
    • Images: 50MB default, configurable up to 200MB
    • Videos: 500MB default, configurable up to 2GB
    • Audio: 100MB default, configurable up to 500MB
  • Show warnings for large files with file size info
  • Provide file size information in media panel (already have file.size)
  • Option to compress images before adding (using browser-image-compression or similar)
  • Check available quota using navigator.storage.estimate()
  • Display storage usage indicator
Anything else?

No response

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách xác định media panel và cách sử dụng file.size hiện có. Quyết định phương pháp validation và các giới hạn loại file nào nằm trong phạm vi, sau đó xác định warnings, quota checks, compression hoặc chunking nên tương tác với nhau như thế nào. Done cần bao gồm các giới hạn có thể cấu hình, phản hồi rõ ràng liên quan đến kích thước và hành vi được xác định cho các upload quá lớn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.