feat: optimize mockup images with WebP and auto-regeneration
Convert mockup source images from JPG to WebP format for 76% size reduction (20MB → 4.7MB). Variants are now auto-generated on startup via Oban, keeping the same DRY approach as database images. Changes: - Add OptimizeWorker.enqueue_mockup/1 for filesystem images - Extend VariantCache to check mockup sources on startup - Update MockupGenerator to save source as optimized WebP - Update .gitignore to ignore generated variants - Convert 55 source mockups from JPG to WebP The mockup pipeline now uses the same code paths as database images: - Optimizer.to_optimized_webp/1 for source conversion - Optimizer.process_file/3 for variant generation - OptimizeWorker for Oban background processing - VariantCache for startup cache validation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@@ -45,11 +45,20 @@ simpleshop_theme-*.tar
|
||||
/priv/static/*.gz
|
||||
# Digested fonts have 32-char hash before extension
|
||||
/priv/static/fonts/*-????????????????????????????????.woff2
|
||||
/priv/static/mockups/*-*.jpg
|
||||
/priv/static/images/*-*.svg
|
||||
/priv/static/images/*-*.svg.gz
|
||||
/priv/static/images/*.gz
|
||||
|
||||
# Generated mockup variants (auto-generated on startup via Oban)
|
||||
# Source .webp files are tracked, variants are regenerated
|
||||
/priv/static/mockups/*-400.*
|
||||
/priv/static/mockups/*-800.*
|
||||
/priv/static/mockups/*-1200.*
|
||||
/priv/static/mockups/*-thumb.jpg
|
||||
|
||||
# Generated image variants cache (regenerated from source images)
|
||||
/priv/static/image_cache/
|
||||
|
||||
# In case you use Node.js/npm, you want to ignore these.
|
||||
npm-debug.log
|
||||
/assets/node_modules/
|
||||
|
||||
Reference in New Issue
Block a user