Uploading Photos
FootyCollect supports multiple ways to upload photos to your items.During Item Creation
When adding a new item, you can upload photos directly:Access the Photo Upload Area
In the item creation form, locate the photo upload section. You’ll see a dropzone area for uploading images.
Upload Your Photos
Method 1: Click to Browse
- Click the upload area
- Select one or multiple image files
- Supported formats: JPG, PNG, WEBP, and other standard image formats
- Drag image files from your computer
- Drop them onto the upload area
- Multiple files can be uploaded at once
Photos uploaded during creation are associated with your user account but not yet linked to a specific item. When you save the item, they’re automatically associated. If you cancel creation, orphaned photos are cleaned up automatically by a scheduled task.
Adding Photos to Existing Items
You can add more photos to items already in your collection:- Navigate to the item detail page
- Click “Add Photos” or “Edit Photos”
- Upload using the same drag-and-drop or browse interface
- New photos are added with automatic ordering
Photo Limitations
| Limit | Value | Notes |
|---|---|---|
| Max Photos Per Item | 10 | Configurable via MAX_PHOTOS |
| Upload Limit (Demo) | Varies | Demo instances may have storage limits |
| File Size | No hard limit | Large files are automatically optimized |
| Allowed Formats | JPG, PNG, WEBP, etc. | Standard image formats |
Photo Processing and Optimization
FootyCollect automatically optimizes all uploaded photos for better performance.Automatic AVIF Conversion
When you upload a photo:Initial Upload
The original image is saved to the
item_photos/ directory. The Photo model stores:image- Original uploaded fileimage_avif- Optimized AVIF version (initially empty)user- Your user ID (for orphan tracking)order- Display ordercaption- Optional caption
Background Processing
A Celery task (This task:
process_photo_to_avif) is automatically queued:- Runs asynchronously in the background
- Converts the original image to AVIF format
- Stores the optimized version in
item_photos_avif/ - AVIF format provides superior compression (smaller files, same quality)
Processing Status Tracking
The item’s
is_processing_photos flag is set to True while photos are being optimized. You can check processing status via:Endpoint: /collection/items/{item_id}/photos/status/Returns:Thumbnail Generation
FootyCollect uses ImageKit to generate thumbnails:- Size: 100x100 pixels
- Format: JPEG
- Quality: 75% compression
- Processing: Resize and crop to fill
Reordering Photos
The first photo in your collection is the main image displayed in lists and previews. You can change the order at any time.Access Reorder Interface
On the item detail or edit page, locate the photo management section. Photos are displayed in their current order.
Drag to Reorder
Drag and drop photos to rearrange them:
- Click and hold on a photo
- Drag it to the new position
- Drop to set the new order
Photo reordering is instant. The main photo changes immediately, affecting how your item appears in collection lists and the feed.
Programmatic Reordering
Thereorder_photos view accepts an array of photo IDs:
order field is updated to match its position in the array.
Adding Captions
Captions help you document specific details about each photo.How to Add Captions
- Navigate to the photo management interface
- Click on a photo or its caption field
- Enter descriptive text (max 255 characters)
- Save to update the photo record
Caption Best Practices
Caption Storage
Captions are stored in thePhoto.caption field:
Deleting Photos
Remove photos from your collection when needed.Select Photo to Delete
In the photo management interface, click the delete button (trash icon) on the photo you want to remove.
External Image Handling
When using FKAPI integration, FootyCollect can download and import images from the Football Kit Archive.How It Works
Image URLs Provided
When you select a kit from FKAPI search:
main_img_url- Primary kit image URLexternal_image_urls- Comma-separated additional image URLs
Image Proxying
External images are proxied through FootyCollect to handle hotlink protection:Proxy Endpoint:
/collection/proxy-image/?url={encoded_url}The proxy:- Validates the URL is from allowed hosts (
cdn.footballkitarchive.com, etc.) - Adds proper
Refererheader to bypass hotlink protection - Limits image size (10MB max)
- Streams the image to the browser
Background Download
When you save the item, external images are downloaded asynchronously:
- Main image is downloaded first (order = 0)
- Additional images follow (order = 1, 2, 3…)
- Each is saved as a Photo record
- AVIF processing is queued for each photo
External image downloads happen in the background. The item is created immediately, and photos appear as they’re downloaded and processed.
Orphaned Photo Cleanup
FootyCollect automatically manages temporary photos that aren’t associated with items.What Are Orphaned Photos?
Photos are “orphaned” when:- Uploaded during item creation but the item wasn’t saved
- Associated with a user but not linked to any item (
object_idis NULL) - Left over from canceled or failed item creation
Automatic Cleanup
A scheduled Celery task runs periodically to clean up orphaned photos:- Finds photos where
object_id IS NULLanduser IS NOT NULL - Checks if the photo is older than the retention period (e.g., 24 hours)
- Deletes the photo and its associated files
- Frees up storage space
Photo Service Layer
FootyCollect uses a service layer for photo operations:Available Methods
| Method | Purpose |
|---|---|
create_photo_with_validation() | Upload photo with validation |
reorder_photos() | Change photo order |
delete_photo() | Remove photo and files |
process_external_images() | Download from URLs |
check_processing_status() | Get AVIF conversion status |
Best Practices
Troubleshooting
Photos Not Processing
If photos remain in “processing” state:- Check the processing status endpoint for your item
- The system auto-retries failed processing every 120 seconds
- Verify Celery workers are running:
celery -A config.celery_app worker -l info
Upload Limits
If you hit upload limits in demo mode:- Check current usage vs. limit (shown in error message)
- Delete old or unnecessary photos
- Consider upgrading to a production deployment (no limits)
Missing AVIF Images
If optimized images aren’t loading:- Check if
image_aviffield has a value - Verify the file exists in storage
- FootyCollect falls back to original image if AVIF is missing
- The
get_image_url()method handles this automatically
Next Steps
- Search your collection - Find items by photo, color, or details
- Privacy settings - Control photo visibility
- Adding items - Learn about FKAPI image import