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

Ged Rid of trailing slash #369

Closed
daslicht opened this issue Mar 27, 2014 · 11 comments
Closed

Ged Rid of trailing slash #369

daslicht opened this issue Mar 27, 2014 · 11 comments
Labels
Level: Bug 🐞 This item involves a legitimate regression (bug) to existing functionality.

Comments

@daslicht
Copy link

Hello,
currently I serve my images as absolute path like this:

{{ image.webPath }} results in:
/files/images/ships/bille/al-042/president-truman-2014-03-27-27-03.jpeg

But when I now add Imagine i get something like this:

{{ image.webPath | imagine_filter('thumb_50x50') results in:
http://capeside_symfony.site/media/cache/thumb_50x50//files/images/ships/bille/al-042/president-truman-2014-03-27-27-03.jpeg

How do I get rid of the extra added slash after the 'thumb_50x50' filter ?

@makasim
Copy link
Collaborator

makasim commented Mar 27, 2014

Ideally you have to path the correct path. It is relative path so you have to path it without first slash.

@havvg wdyt?

@daslicht
Copy link
Author

But in that case My images get broken when I try to navigate

@daslicht
Copy link
Author

In "liip/imagine-bundle": "v0.21.1" its working as expected with my absolute path.

@makasim
Copy link
Collaborator

makasim commented Mar 27, 2014

@daslicht lot's of things was changed since than. Some of them with BC breaks. I tend to think that this is a bug. Let's fix it

@daslicht
Copy link
Author

@makasim: Thank you very much !

@makasim
Copy link
Collaborator

makasim commented Mar 27, 2014

@daslicht I tried to reproduce the issue but without luck.

This what I have in my sandobx:

<div style="float: left; margin-right: 15px; width: 220px">
    <p>Default</p>
    <img src="{{ '/images/dream.jpg' | imagine_filter('thumbnail_default') }}" />
</div>

and this the filter and cache action url:

http://dev.liip-imagine-sandbox.com/media/cache/thumbnail_default/images/dream.jpg

please post your config or any other information you may find valuable.

@daslicht
Copy link
Author

@makasim makasim added the Bug label Mar 29, 2014
@ama3ing
Copy link

ama3ing commented Apr 22, 2014

I can confirm that issue exists. My config.yml looks like:

liip_imagine:
  driver: gd
  loaders:
      default:
        filesystem:
          data_root: %kernel.root_dir%/images

Twig template looks like:

<img src="{{ image.fullPath | imagine_filter('full') }}" class="img-responsive"/>

Where getFullPath() method returns something like /property/4/5342ec39ce57c.jpg

I think the bug appears only when custom data_root or web_root is set

But there is workaround to resolve this, just remove first slash. In example:
<img src="{{ 'property/4/5342ec39ce57c.jpg' | imagine_filter('full') }}" />

But nevertheless this way isn't good way.

ama3ing pushed a commit to ama3ing/LiipImagineBundle that referenced this issue Apr 22, 2014
@makasim
Copy link
Collaborator

makasim commented Apr 22, 2014

Haven't you updated the bundle lately? 1.0.0-alpha4 has to have a fix of this issue. Could you test it?

@ama3ing
Copy link

ama3ing commented Apr 22, 2014

Just updated, seems like it's not fixed. I receive the same problem.
/media/cache/full//property/4/5342ec39ce57c.jpg

ama3ing pushed a commit to ama3ing/LiipImagineBundle that referenced this issue Apr 24, 2014
ama3ing pushed a commit to ama3ing/LiipImagineBundle that referenced this issue Apr 24, 2014
makasim added a commit that referenced this issue Apr 29, 2014
Fix of #369 (Trim of forwarding slash in path)
@ama3ing
Copy link

ama3ing commented May 9, 2014

@makasim, close this issue. It is not exist anymore.

@makasim makasim closed this as completed May 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Level: Bug 🐞 This item involves a legitimate regression (bug) to existing functionality.
Projects
None yet
Development

No branches or pull requests

3 participants