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:1
Access the Photo Upload Area
In the item creation form, locate the photo upload section. You’ll see a dropzone area for uploading images.
2
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
3
Monitor Upload Progress
Each photo shows:
- Upload progress bar
- Thumbnail preview
- File name and size
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
Photo Processing and Optimization
FootyCollect automatically optimizes all uploaded photos for better performance.Automatic AVIF Conversion
When you upload a photo:1
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
2
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)
3
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:4
Completion
When all photos are processed:
is_processing_photosis set toFalse- The item’s draft status is removed
- Optimized AVIF images are served to users
- Original images are kept as fallback
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.1
Access Reorder Interface
On the item detail or edit page, locate the photo management section. Photos are displayed in their current order.
2
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
3
Save New Order
The reorder is saved via POST to:With data:The
PhotoService.reorder_photos() method updates the order field for each photo.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.1
Select Photo to Delete
In the photo management interface, click the delete button (trash icon) on the photo you want to remove.
2
Confirm Deletion
Confirm the deletion when prompted. This action cannot be undone.
3
Files Removed from Storage
The
Photo.delete() method:- Removes the database record
- Deletes the original image file from
item_photos/ - Deletes the AVIF version from
item_photos_avif/ - Cleans up storage to free space
External Image Handling
When using FKAPI integration, FootyCollect can download and import images from the Football Kit Archive.How It Works
1
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
2
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
3
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
4
Photo Association
Downloaded photos are associated with the item:
content_type= BaseItem content typeobject_id= Item’s IDuser= Your user ID
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
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