Hello, I try install that Bundle but I have problem,
I installed that budle and I configured it but it isn't working.
My config:
"liip_imagine:
driver: gd
web_root: %kernel.root_dir%/../web
data_root: %kernel.root_dir%/../web
cache_mkdir_mode: 0777
cache_prefix: /media/cache
cache: web_path
cache_clearer: true
data_loader: filesystem
controller_action: liip_imagine.controller:filterAction
formats: []
filter_sets:
my_thumb:
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }"
and I use it <img src="{{ asset('dostep_desc.png') | imagine_filter('my_thumb') }}">
When I try go to site with that img i have url to file (/jks2/web/app_dev.php/media/cache/my_thumb/jks2/web/dostep_desc.png)
And I have strange line in my log
[2012-11-01 14:01:01] request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: Source image not found in "" (uncaught exception) at C:\xampp\htdocs\jks2\vendor\liip\imagine-bundle\Liip\ImagineBundle\Imagine\Data\Loader\FileSystemLoader.php line 88 [] []
Could you help me?
seems the issue will be the url, i had the same problem, if i don't use a top-level domain on my notebook
make sure to adjust the web root path setting.
ping
Hi, I'm experiencing the same issue in my project. Any succeeded in finding a fix ?
Just to be sure, you are using the current version?
What's your configuration, and what's the code in your template + what's the value of any variable used in the template to retrieve the image?
Thanks for the reply.
Here's my composer.json
"require": {
...
"liip/imagine-bundle": "dev-master",
...
},
I used the default configuration.
_imagine:
resource: .
type: imagine
liip_imagine:
filter_sets:
my_thumb:
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }
Here's my template code
<img src="{{ asset('uploads/media/' ~ m.image )| imagine_filter('my_thumb') }}" alt="{{ m.titre }}" />
and the html output:
<img src="/Essai/web/app_dev.php/media/cache/my_thumb/Essai/web/uploads/media/a269f8c64cef84c034b9e646b7b07f40bec738d1.jpeg" alt="Une photo1">
That's because of {{ asset('uploads/media/' ~ m.image )| imagine_filter('my_thumb') }}, you are doubling the path, try {{ m.image|imagine_filter('my_thumb') }}.
To enable asset versioning, you can use it this way around: {{ asset(m.image|imagine_filter('my_thumb')) }}
But make sure, your assets_version_format does not alter the path, or if so, your resolver or webserver knows how to rewrite the url accordingly.
That method completely change the image path in the source code:
<img src="/Essai/web/uploads/media//Essai/web/app_dev.php/media/cache/my_thumb/a269f8c64cef84c034b9e646b7b07f40bec738d1.jpeg" alt="Photo3">
It still looks like you are using the wrong combination in your template, did you try the basic {{ m.image|imagine_filter('my_thumb') }}?
What's in m.image? It should read a269f8c64cef84c034b9e646b7b07f40bec738d1.jpeg only.
i still have the same problem
I tried various ways but couldn't get it work. I think it's all related to finding a way to provide a relative path as it is required in the Readme. asset() returns an absolute path. I'm working on Windows and my project's path is C:/wamp/www/Essai/. asset() generates a path like this Essai/web/. The problem is to know where does a relative path begins in Symfony2. The project folder or the 'web' folder? I manually tried both of them, even for css files and none worked. Files only work with a asset() call. Excuse me for the question, I'm very new to Symfony2
Actually, when using this bundle, there is no need for the asset. The URL is correctly returned by imagine_filter.
The asset will break it, if not used correctly. I see no actual use case for this, because the assets_version may not change when the image is updated, but that's part of the users problem or feature, depends how it is used :-)
What do you mean by 'relative path'?
The relative path of a URL for your application pointing to a file, will start off right after the configured web directory of your application, defaults to web directory, so a file in web/foo/bar.jpg would result in /foo/bar.jpg
Got it finally.
That's indeed a common mistake when dealing with Twig :)
@JackJones does this solve your issue, too?
If not, what's your setup, output, etc.?
when i want to display the image it does not display any thing
src="{{ '{{ app.request.basepath }}/uploads/index.jpg' | imagine_filter('my_thumb', runtimeConfig) }}"
Most helpful comment
Got it finally.