Skip to content
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

Wrong image URL in v1.0 #349

Closed
gentisaliu opened this issue Mar 17, 2014 · 7 comments
Closed

Wrong image URL in v1.0 #349

gentisaliu opened this issue Mar 17, 2014 · 7 comments

Comments

@gentisaliu
Copy link

After updating to v1.0, the generated image URLs from LiipImagineBundle (I use getBrowserPath) are no longer valid. My Symfony2 application is accessible under:
http://localhost/symfony/app_dev.php

LiipImagineBundle generates URL such as:
http://localhost/media/cache/my_filter/media/images/user/6e5d32be98f9c16df9a56460f0b083f199dd7790.jpeg

The correct URL would be:
http://localhost/symfony/media/cache/my_filter/media/images/user/6e5d32be98f9c16df9a56460f0b083f199dd7790.jpeg

Since the config options had changed quite a bit in this new version, is there any other config option I need to set to obtain the correct URL?

Thanks.

@gentisaliu gentisaliu changed the title Wrong image URL in v0.21 Wrong image URL in v0.5 Mar 17, 2014
@gentisaliu gentisaliu changed the title Wrong image URL in v0.5 Wrong image URL in latest version Mar 17, 2014
@gentisaliu gentisaliu changed the title Wrong image URL in latest version Wrong image URL in v0.21 Mar 17, 2014
@makasim
Copy link
Collaborator

makasim commented Mar 17, 2014

any options were changed in 0.21. Are you sure you updated the code up to 0.21 not 1.0?

@gentisaliu
Copy link
Author

I'm sorry, of course I updated to 1.0, not 0.21, I just checked composer.json, I referred to the "releases" section of the project earlier for the version number.

But still the question above remains. Thanks.

@gentisaliu gentisaliu changed the title Wrong image URL in v0.21 Wrong image URL in v1.0 Mar 17, 2014
@makasim
Copy link
Collaborator

makasim commented Mar 17, 2014

I think the url is correct, Why do you think it has to start from symfony?

There is an option you can use to change the prefix back:

liip_imagine:
  resolvers:
    web_path:
      web_path:
        cache_prefix: symfony/media/cache

@gentisaliu
Copy link
Author

The symfony part of the URL is not a real directory but simply an Apache alias pointing to an arbitrary directory in the filesystem.

I did set the cache prefix earlier as you suggest above and it worked, but the problem with this solution is that this creates a symfony directory in my web folder, which I do not want.

Is it possible to not have the symfony directory created in the web folder with my setup?

This was possible with the older version of LiipImagineBundle. Here's what my config looked like back then:

liip_imagine:
    cache_prefix: /media/cache

@gentisaliu
Copy link
Author

Any ideas? This issue has been affecting the entire experience with the site since the update...

@makasim
Copy link
Collaborator

makasim commented Mar 18, 2014

I dont think it was working before. Except I cannot imagine how it was possible.

For now you can switch back to 0.x branch or extend resolver class and add the prefix to resolve method.

@gentisaliu
Copy link
Author

Okay, reverted to 0.x branch and everything is working as before.

The URL now looks like this:
http://localhost/symfony/app_dev.php/media/cache/my_filter/media/images/user/6e5d32be98f9c16df9a56460f0b083f199dd7790.jpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants