Photo Upload Process
Dropzone Interface
FootyCollect uses a drag-and-drop interface for uploading photos:- Drag files onto the dropzone area or click to browse
- Multiple uploads: Upload up to 10 photos per item
- Instant preview: See thumbnails as files upload
- Progress tracking: Monitor upload progress for each file
Supported Formats
FootyCollect accepts the following image formats:- JPEG (.jpg, .jpeg)
- PNG (.png)
- WebP (.webp)
- GIF (.gif)
- AVIF (.avif)
All uploaded images are automatically converted to AVIF format for optimal compression and quality, regardless of the original format.
File Size Limits
- Maximum file size: 15 MB per photo
- Maximum photos per item: 10 photos
- Recommended resolution: Up to 3840×2160 (4K) for best results
Automatic AVIF Optimization
FootyCollect uses thepillow-avif-plugin to automatically convert all uploaded photos to AVIF format, which provides superior compression compared to JPEG and PNG.
How It Works
- Upload: You upload your photo in any supported format
- Background processing: Celery task processes the image asynchronously
- Smart conversion:
- Detects transparency in images (PNG with alpha channel)
- Preserves transparency by converting to RGBA mode
- Converts images without transparency to RGB mode
- Resize if needed: Images larger than 3840×2160 are resized while maintaining aspect ratio
- Quality optimization: Saves at 90% quality for optimal balance
- Dual storage: Original and AVIF versions are both stored
AVIF Benefits
- 50% smaller files: AVIF typically produces files 50% smaller than JPEG at the same quality
- Better quality: Superior compression algorithm preserves more detail
- Transparency support: Full alpha channel support like PNG
- Modern codec: Based on AV1 video codec technology
- Fallback support: Original image serves as fallback if AVIF isn’t supported
The AVIF conversion happens in the background using Celery. Your photo is immediately available (using the original format) while the AVIF version is being generated.
Thumbnail Generation
FootyCollect automatically generates thumbnails for all photos using ImageKit:- Size: 100×100 pixels (square crop)
- Format: JPEG at 75% quality
- Lazy generation: Thumbnails are generated on-demand, not during upload
- Caching: Thumbnails are cached for fast loading
Use Cases
- Collection grid views
- Photo carousels
- User profile photo galleries
- Search results preview
Photo Organization
Photo Ordering
Photos are displayed in the order you specify:- Drag to reorder: Use drag-and-drop to change photo order
- Main photo: The first photo (order 0) is the main photo shown in lists
- Manual ordering: Photos have an
orderfield that determines display sequence
Photo Captions
Add captions to provide context:- Optional: Captions are not required
- 255 character limit: Keep captions concise
- Display: Shown in photo galleries and detail views
Reordering Photos
You can reorder photos after upload:Photo Validation
FootyCollect validates photos during upload:File Size Check
Content Type Check
Count Limit
Smart Image Delivery
FootyCollect serves the best image format for each request:- AVIF first: Serves AVIF version if available
- Automatic fallback: Falls back to original if AVIF processing failed
- Storage check: Verifies file exists before serving
Photo Deletion
Deleting photos properly cleans up all associated files:- Database cleanup: Removes photo records
- File cleanup: Deletes both original and AVIF files
- Automatic: Happens when you delete an item or individual photo
Orphaned Photo Cleanup
FootyCollect includes a Celery task that cleans up orphaned photos (photos uploaded but not associated with any item):- Scheduled task: Runs periodically via Celery Beat
- Grace period: Photos must be older than a threshold before deletion
- Automatic: No manual intervention needed
Orphaned photos are created when users upload photos but don’t complete the item creation form. The cleanup task removes these after a grace period.
Best Practices
- Upload high-resolution photos: FootyCollect will optimize them automatically
- Use multiple angles: Show front, back, tags, and details
- Choose the best main photo: First photo appears in lists and feeds
- Add captions for context: Explain special features or condition details
- Let AVIF conversion complete: Wait for background processing for best performance
- Take well-lit photos: Good lighting shows true colors and condition