siqu/thumbnail

A Symfony bundle to generate thumbnails on the fly.

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:symfony-bundle

1.3.0 2018-07-31 09:25 UTC

This package is not auto-updated.

Last update: 2024-05-01 18:48:40 UTC


README

Build Coverage report

Bundle provides a controller to create thumbnails on demand.

Include the routing via:

siqu_thumbnail:
    resource: "@SiquThumbnailBundle/Resources/config/routing.yml"
    type:     yaml
    prefix:   /{PREFIX}

This route will create the requested thumbnail and store the generated file inside the symfony cache. The image name will be resolved via the config and the resulting cache file will be stored in a subdirectory, which can be configured via the config inside of the symfony cache directory.

The resulting thumbnail will receive a cache header with a configurable max_age.

When the original file changed it will create a new cache file.

Configuration can me made with the following settings:

siqu_thumbnail:
    image_dir:  %kernel.root_dir%/Resources/images (default)
    cache_dir:  %kernel.cache_dir%/thumbnails (default)
    cache_time: 604800 (default 1 week)

Thumbnails can then be delivered via the route

/{PREFIX}/{width}/{height}/{imageName}