
parameters:
    image.handling.class: Gregwar\ImageBundle\Services\ImageHandling
    image.handler.class: Gregwar\ImageBundle\ImageHandler

services:
    # Image handling factory
    image.handling:
        class: '%image.handling.class%'
        public: true
        arguments:
          - '%gregwar_image.cache_dir%'
          - '%gregwar_image.cache_dir_mode%'
          - '%image.handler.class%'
          - '@service_container'
          - '@assets.packages'
          - '@file_locator'
          - '%gregwar_image.throw_exception%'
          - '%gregwar_image.fallback_image%'

    # Helper Twig
    twig.extension.image:
        class: Gregwar\ImageBundle\Extensions\ImageTwig
        arguments: ['@image.handling', '%gregwar_image.web_dir%']
        tags:
            - { name: twig.extension }
