Gregwar/ImageBundle — pull request #21 by kenshaw (2013-02-23 04:05:50+00:00)
Title: Allow the bundle to be used from the command line

Moving to further late binding of templating.helper.assets on Image filename callback

This allows this bundle to be used from the commandline for processing images
(if not using templates). Additionally, completely ignores the callback if a
path begins with '/', as all {{ asset }} tag calls (which is where this would
come into play) use relative URLs.

Without this, when invoking a Symfony2 CLI Command using code that depends on this library, an exception gets thrown that the templating.helper.assets service cannot be created due to the lack of the HTTP / Request environment:

[Symfony\Component\DependencyInjection\Exception\InactiveScopeException]
You cannot create a service ("templating.helper.assets") of an inactive scope ("request").