See ImageStack\ImageBackend\HttpImageBackend Cache image backendĪdd a cache layer before an image backend. See ImageStack\ImageBackend\FileImageBackend HTTP image backend See ImageStack\ImageStack Image backends File image backend $image = $stack-> stackImage( new \ ImageStack\ ImagePath( $path)) $oim-> registerImageOptimizer( new \ ImageStack\ ImageOptimizer\ JpegtranImageOptimizer()) $oim = new \ ImageStack\ ImageManipulator\ OptimizerImageManipulator() New \ ImageStack\ StorageBackend\ FileStorageBackend( '/var/www/my/local/image/storage/')) New \ ImageStack\ ImageBackend\ HttpImageBackend( ''), store it on '/var/www/my/local/image/storage/' $path.This pseudo controller creates an image stack that will: See ImageStack\Api\StorageBackendInterface. Typically we could store it onto the file system so that next HTTP query will be statically serve. Something where we can store the image content. See ImageStack\Api\ImageManipulatorInterface. Service that can modify/transform/optimize the image content. See ImageStack\Api\ImageBackendInterface. Something that can provide image content. The image content we are willing to serve. The path of the image that could come from the front controller. Ideally the image file will be stored so that the next HTTP request will be statically served. the front controller will serve the image.the image stack will return the image to the front controller.the image stack will store the image using the storage backend.the image stack will apply image manipulator.the image stack will fetch the image using the image backend.the front controller will call image stack with the image path.When the front controller handles an image HTTP request: This describes the typical processing we want to achieve. Installation composer require quazardous/imagestack The framework is brick designed so that you can put together your own image serving project and add special bricks. The main goal is to provide a robust framework to create an "on the fly" image thumbnailer generator similar to imagecache / image style in Drupal.
0 Comments
Leave a Reply. |