Image Upload Demo

Upload Image

Max 3 images | JPG/PNG only | Max 2MB per file
Select an image file to upload (0/3)
Requirements: JPG or PNG format only, maximum file size 2MB
No images uploaded yet. Use the form above to upload your first image.

Automatic Image Variants

When you upload an image, the system automatically creates multiple resized versions:

  • Thumbnail - 150x150px (zoom-crop to fill entire square, no distortion)
  • Medium - 400x400px (maintains aspect ratio)
  • Large - 800x800px (maintains aspect ratio)

These variants are stored in the database's variants JSON field and can be accessed programmatically.

How it works

  1. Select an image file using the file input
  2. The FileStorage behavior automatically processes the upload
  3. The ImageProcessor creates multiple resized versions (variants)
  4. File metadata and variant information are stored in the database
  5. The physical files are stored on disk using the configured path template
  6. Images are optimized to reduce file size

Path Structure

Original files:
FileStorage/images/{randomPath}/{id}/{filename}.{extension}

Variant files:
FileStorage/images/{randomPath}/{id}/{filename}.{hashedVariant}.{extension}

Technology Stack

  • FlySystem - Storage abstraction layer
  • Intervention Image - Image manipulation library
  • Image Optimizer - Automatic file size optimization

Send your feedback or bugreport!