LiipImagineBundle: Multiple "Source image could not be found" since 1.7 update
Since the update to 1.7, I have problems with images not being found and therefore no image beeing generated by the bundle.
Error is “Source image could not be found”, and “[1/2] NotLoadableException: Source image invalid “C:\wamp\www\MyProject\src\MyBundle\Resources\public\images\icon.png” as it is outside of the defined root path”.
I haven’t changed my config
liip_imagine:
resolvers:
default:
web_path: ~
filter_sets:
cache: ~
thumb:
filters:
background: { size: [1140, 400], color: '#fff' }
strip: ~
I’m also using VichUploaderBundle and the Symfony asset versioning system
framework:
assets:
version: 'X'
so my Twig looks either like
{{ asset('bundles/mybundle/images/icon.png'|imagine_filter('thumb')) }}
or
{{ vich_uploader_asset(enity, 'iconFile')|imagine_filter('thumb') }}
My assets are installed with symbolic links.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 34 (6 by maintainers)
Solved with following config:
For example, given the following folders within
%kernel.root_dir%/../webYou would have the following as your config for
data_rootThanks @robfrawley.
@picks44 The way Symfony merges “array” configuration, your values for
data_rootwill be merged together, meaning the"%kernel.root_dir%/../../../shared/web"path will always exist. For example, in production, your config would result in:Whereas, in development environment, it would result in:
To get around this merge handling of the Symfony Tree Building, move the config from
config.ymlintoconfig_prod.yml, so that you have completely separate and independent configs for your production and development environments, without any merge functionality occuring on theliip_imagineblock.@picks44 Regarding “directory separators,” I don’t use Windows, but I do know on Linux you cannot use Windows directory separators. Perhaps Windows automatically allows the use of Linux separators; I have no experience working with PHP on this OS, though, so IDK.
@picks44 maybe are you using symlinks to cached image? I have same error with deployer and symlinks