private function saveOrOutput($format, array $options, $filename = null)
{
$format = $this->normalizeFormat($format);
if (!$this->supported($format)) {
throw new InvalidArgumentException(sprintf('Saving image in "%s" format is not supported, please use one of the following extensions: "%s"', $format, implode('", "', $this->supported())));
}
$save = 'image'.$format;
$args = array(&$this->resource, $filename);
if ($binary->getFormat() === 'gif' && $config['animated']) {
$options['animated'] = $config['animated'];
}
$filteredFormat = isset($config['format']) ? $config['format'] : $binary->getFormat();
$filteredContent = $image->get($filteredFormat, $options);
$filteredMimeType = $filteredFormat === $binary->getFormat() ? $binary->getMimeType() : $this->mimeTypeGuesser->guess($filteredContent);
// We are done with the image object so we can destruct the this because imagick keeps consuming memory if we don't
// See https://github.com/liip/LiipImagineBundle/pull/682
if (method_exists($image, '__destruct')) {
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = \call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
//$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
InvalidArgumentException |
---|
Imagine\Exception\InvalidArgumentException: Saving image in "bmp" format is not supported, please use one of the following extensions: "gif", "jpeg", "png", "wbmp", "xbm" at vendor/imagine/imagine/lib/Imagine/Gd/Image.php:536 at Imagine\Gd\Image->saveOrOutput('bmp', array('quality' => 100)) (vendor/imagine/imagine/lib/Imagine/Gd/Image.php:258) at Imagine\Gd\Image->get('bmp', array('quality' => 100)) (vendor/liip/imagine-bundle/Imagine/Filter/FilterManager.php:156) at Liip\ImagineBundle\Imagine\Filter\FilterManager->apply(object(FileBinary), array('filters' => array(), 'quality' => 100, 'animated' => false, 'jpeg_quality' => null, 'png_compression_level' => null, 'png_compression_filter' => null, 'format' => null, 'cache' => null, 'data_loader' => null, 'default_image' => null, 'post_processors' => array())) (vendor/liip/imagine-bundle/Imagine/Filter/FilterManager.php:213) at Liip\ImagineBundle\Imagine\Filter\FilterManager->applyFilter(object(FileBinary), 'blog_thumb') (vendor/liip/imagine-bundle/Controller/ImagineController.php:114) at Liip\ImagineBundle\Controller\ImagineController->filterAction(object(Request), 'data/blog/229152/6e53af90f1a2d20ac3aa4aa7779cca57.bmp', 'blog_thumb') (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (web/app.php:22) |