ImageStorage is available through composer package ublaboo/image-storage:
composer require ublaboo/image-storage
The abilities are:
- Store any other image
- Set quality of resized
- Set transformation of resized
- Delete all "cached" files made from original
Once the ImageStorage served and altered image, it will be used for all other requests for that specific altered file (works like cache).
You are saving files within particular namespaces (eg 'avatars'). For better filesystem optimization, target files are saved in <namespace>/<hash>/<file.ext>, where the hash is made from first 2 characters of sha1 hash (or some other configured hashing algorithm) of target file. Therefore there won't be thousands of files in one directory, but files will be distributed under that hash-named directories.
How to save an upload...
You simply pass a size parameter to either Latte macro or Latte n:macro or directly ImageStorage. Or crop measures or quality or transformation flag. Or some of these combined. You can also combine the transformation flags with + sign.
How to transform an image...
Once you want to delete an image, you should delete all other transformed images made from the original one.
See how to delete an image...
The transformed image name does not look to much friendly (eg /avatars/kitty.200x200.fit.jpg). You can change the method of creating links to images in configuration file so the link will look