-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple "Source image could not be found" since 1.7 update #849
Comments
Please see if #851 resolves your issue. |
Well I have to wait for v1.7.1 to try this as I guess I have several data_root pah to configure (one for the bundle images, and one for the manual user uploads). |
To me this new config is not really "user-friendly"... |
Now I have the error My confil.yml
|
@picks44 try Regards |
@picks44 maybe are you using symlinks to cached image? I have same error with deployer and symlinks |
@picks44 You absolutely forgot a |
@picks44 This configuration isn't new, the root check is simply more secure, and takes symbolic links into account. If you aren't using symbolic links there is no need to set this configuration option. What is new is the ability to define multiple root paths. |
Version 1.7.1 released with multiple data roots support. |
@robfrawley @edvinasnet @adaniloff Thanks, sorry for my basic mistake, I went over too quickly... Will try this new version. |
It's strange, on my dev env (WIndows), I don't need to use the data_root option, but in prod env (Debian) it's looks like i do. Basically my assets are in the web/bundle/mybundle/images (hard copy) and in web/uploads/* (several folders for several types of uploads). Do I need to set a data_root for EVERY folder ? |
@picks44 If they are symbolic links, yes (you should set their destination as |
@picks44 You can determine if any symbolic links exist using the
|
For example, given the following folders within
You would have the following as your config for data_root:
- %kernel.root_dir%/../web
- /some/other/path |
@picks44 Is you issue resolved? |
I'm getting the same issue. Thumbnails are not working anymore since last upgrade. I can't get any error in logs. Configuration in dev looks fine, there is a |
OK I managed to log errors and I found the following:
I'm using capifony for deploy, I think that's a pretty common solution. How could be possible that you broke it on a minor release? 😥 |
@garak I'm using Capifony to deploy too, and I'm currently trying to get this working. Will give you some updates soon. |
Solved with following config: liip_imagine:
# ...
# see https://github.com/liip/LiipImagineBundle/issues/849
loaders:
default:
filesystem:
data_root:
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../../../shared/web" |
@garak yes I was trying this also. Did you put this in your config.yml or config_prod.yml ? |
When I tried to debug this problem I checked |
I put it directly in |
Strange, if I do this in my config.yml
And this in my config_dev.yml
The app still takes into account the config.yml configuration... Isn't it supposed to be overwritten by config_dev.yml ? |
I think that there's no need to override your config_dev, when I tried with config only, it worked. Anyway, I then moved it to config_prod |
@garak @robfrawley if I do not override my config.yml, then I get this error on ALL my processed images |
You are using the wrong "slash" character in your paths. On Windows, the correct one is
It sounds like it is overwriting the configuration, which is why when you have the configuration in You can try the following to test this: create a PHP file with the following and execute it. <?php
var_dump(realpath("C:\wamp\www\MyBundle\app/../../../shared/web")); It will output |
@garak @picks44 As for when to use
You use that exact same logic when overwriting configuration from the global ( |
@garak I'd be happy to merge a PR from you that includes additional logging statements in the |
To clarify a bit, the configurations are not only overridden but also merged. Given your # config.yml
liip_imagine:
resolvers:
default:
web_path: ~
loaders:
default:
filesystem:
data_root:
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../../../shared/web" # config_dev.yml
liip_imagine:
loaders:
default:
filesystem:
data_root:
- "%kernel.root_dir%/../web" The resolved configuration for the production environment is liip_imagine:
resolvers:
default:
web_path: ~
loaders:
default:
filesystem:
data_root:
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../../../shared/web" And the resolved configuration for the development environment is liip_imagine:
resolvers:
default:
web_path: ~
loaders:
default:
filesystem:
data_root:
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../../../shared/web" |
You likely want the configuration to apply to both your production and development environment. Therefore it should be in |
@robfrawley This is exactly what I'm doing and in dev environment I get the same error on all images I've also tried writing my config like this
But I get the exact same error (in dev mode). |
@picks44 The way Symfony merges "array" configuration, your values for data_root:
# from `config.yml`
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../../../shared/web" Whereas, in development environment, it would result in: data_root:
# from `config_dev.yml`
- "%kernel.root_dir%/../web"
# from `config.yml`
- "%kernel.root_dir%/../web"
- "%kernel.root_dir%/../../../shared/web" To get around this merge handling of the Symfony Tree Building, move the config from @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. |
Thanks @robfrawley. |
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
I'm also using VichUploaderBundle and the Symfony asset versioning system
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.
The text was updated successfully, but these errors were encountered: