{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/842","labels_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/842/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/842/comments","events_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/842/events","html_url":"https://github.com/sonata-project/SonataMediaBundle/issues/842","id":105408910,"number":842,"title":"Liip imagine bundle 1.3 integration ","user":{"login":"redayoub","id":5278152,"avatar_url":"https://avatars.githubusercontent.com/u/5278152?v=3","gravatar_id":"","url":"https://api.github.com/users/redayoub","html_url":"https://github.com/redayoub","followers_url":"https://api.github.com/users/redayoub/followers","following_url":"https://api.github.com/users/redayoub/following{/other_user}","gists_url":"https://api.github.com/users/redayoub/gists{/gist_id}","starred_url":"https://api.github.com/users/redayoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redayoub/subscriptions","organizations_url":"https://api.github.com/users/redayoub/orgs","repos_url":"https://api.github.com/users/redayoub/repos","events_url":"https://api.github.com/users/redayoub/events{/privacy}","received_events_url":"https://api.github.com/users/redayoub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-08T15:43:03Z","updated_at":"2015-09-22T11:45:26Z","closed_at":null,"body":"Hello,\r\n\r\nI'm trying to integrate the liip imagine bundle, I've followed the steps described in the doc but it's not working.\r\n\r\nHere's my config:\r\n\r\nconfig.yml\r\n\r\n```yml\r\nsonata_media:\r\n    default_context: default\r\n    db_driver: doctrine_orm\r\n    contexts:\r\n        default:\r\n            providers:\r\n                - sonata.media.provider.image\r\n            formats:\r\n                icon:  { width: 20, height: 20, quality: 70}\r\n                small: { width: 180, height: 180, quality: 70}\r\n                big:   { width: 500, height: 500, quality: 70}\r\n        ads:\r\n            providers:\r\n                - sonata.media.provider.image\r\n            formats:\r\n                thumb: { width: 170, height: 130, quality: 70}\r\n                normal: { width: 500, quality: 70}\r\n    cdn:\r\n        server:\r\n            path: /uploads/media\r\n    filesystem:\r\n        local:\r\n            directory:  %kernel.root_dir%/../web/uploads/media\r\n            create:     false\r\n    providers:\r\n        image:\r\n            service:    sonata.media.provider.image\r\n            resizer:    sonata.media.resizer.simple\r\n            filesystem: sonata.media.filesystem.local\r\n            cdn:        sonata.media.cdn.server\r\n            generator:  sonata.media.generator.default\r\n            thumbnail:  sonata.media.thumbnail.liip_imagine\r\n            allowed_extensions: ['jpg', 'png', 'jpeg']\r\n            allowed_mime_types: ['image/pjpeg', 'image/jpeg', 'image/png', 'image/x-png']\r\n\r\nliip_imagine:\r\n    filter_sets:\r\n        ads_small:\r\n            quality: 75\r\n            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'\r\n            filters:\r\n                thumbnail: { size: [170, 130], mode: inset }\r\n                background: { size: [170, 130], color: '#eee' }\r\n```\r\n\r\nrouting.yml\r\n\r\n```yml\r\n_liip_imagine:\r\n    resource: \"@LiipImagineBundle/Resources/config/routing.xml\"\r\n```\r\n\r\nWhen I try to render a media:\r\n\r\n```twig\r\n{% thumbnail media, 'thumb' %}\r\n```\r\n\r\nThe first error that I get is:\r\n\r\n`Unrecognized option \"controller_action\" under \"liip_imagine.filter_sets.ads_small\"`\r\n\r\nI fixed that by replacing this:\r\n\r\n```yml\r\ncontroller_action: 'SonataMediaBundle:Media:liipImagineFilter'\r\n```\r\n\r\nby:\r\n\r\n```yml\r\nliip_imagine:\r\n    controller:\r\n        filter_action: 'SonataMediaBundle:Media:liipImagineFilter'\r\n```\r\n\r\nthen I got this new error:\r\n\r\n`Unable to generate a URL for the named route \"_imagine_ads_small\" as such route does not exist.`\r\n\r\nSo I looked for a solution and I found this:\r\n\r\n```php\r\nnamespace Sonata\\MediaBundle\\Thumbnail;\r\n\r\npublic function generatePublicUrl(MediaProviderInterface $provider, MediaInterface $media, $format)\r\n{\r\n    if ($format == 'reference') {\r\n        $path = $provider->getReferenceImage($media);\r\n        return $provider->getCdnPath($path, $media->getCdnIsFlushable());\r\n    } else {\r\n        $path = $this->router->generate('liip_imagine_filter',array(\r\n            'filter' => $format,\r\n            'path'=> $provider->getReferenceImage($media)\r\n        ));\r\n        return $path;\r\n    }\r\n}\r\n```\r\nIt has fixed the previous error but the code generated is like: \r\n\r\n```html\r\n<img src=\"/uploads/media/app_dev.php/fr/media/cache/resolve/ads_small/ads/0001/01/2896725d5ff255e572e308caf39f4a5c5721fa2c.jpeg\">\r\n```\r\n\r\nI removed `/uploads/media/` in the begining of the path by repacing:\r\n\r\n```yml\r\nsonata_media:\r\n    cdn:\r\n        server:\r\n            path: /uploads/media\r\n```\r\n\r\nby\r\n\r\n```yml\r\nsonata_media:\r\n    cdn:\r\n        server:\r\n            path: ''\r\n```\r\n\r\nso the path now is like: \r\n\r\n```html\r\n<img src=\"app_dev.php/fr/media/cache/resolve/ads_small/ads/0001/01/2896725d5ff255e572e308caf39f4a5c5721fa2c.jpeg\">\r\n```\r\n\r\nbut the image is not found and when I check the /web/media folder there's no cache folder or files generated.\r\n\r\nNote: I tested liipimagine bundle without using sonata and it works, It generates a cache directory with other subdirectories and files.\r\n\r\nAny help please?"},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/comments/142262676","html_url":"https://github.com/sonata-project/SonataMediaBundle/issues/842#issuecomment-142262676","issue_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/842","id":142262676,"user":{"login":"Tomasseee","id":6481761,"avatar_url":"https://avatars.githubusercontent.com/u/6481761?v=3","gravatar_id":"","url":"https://api.github.com/users/Tomasseee","html_url":"https://github.com/Tomasseee","followers_url":"https://api.github.com/users/Tomasseee/followers","following_url":"https://api.github.com/users/Tomasseee/following{/other_user}","gists_url":"https://api.github.com/users/Tomasseee/gists{/gist_id}","starred_url":"https://api.github.com/users/Tomasseee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tomasseee/subscriptions","organizations_url":"https://api.github.com/users/Tomasseee/orgs","repos_url":"https://api.github.com/users/Tomasseee/repos","events_url":"https://api.github.com/users/Tomasseee/events{/privacy}","received_events_url":"https://api.github.com/users/Tomasseee/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T11:45:26Z","updated_at":"2015-09-22T11:45:26Z","body":"I'm also searching for a solution, but nothing found yet. :("}}