Ben regarding your problem some more, I just did some testing on my own server and pointed the Image Sizer plugin to an incorrectly typed image path (absolute path) and nothing came up in the source code on my server so I am thinking that perhaps because of the way you have your server set up and utilising a hosts file (still don’t know what all that is about 😉 ) that maybe this is what is causing it.
Do you possibly have a site online where you can test this out without any of the hosts files stuff as it might just be that the plugin can’t find the image due to that fact. Even if I tried using the just_check=”yes” or just_url=”yes” parameters on my server if I gave it an incorrect value for the src=”“ parameter then absolutely nothing comes up in the source.
Just an idea though.
Dalio,
Regarding your query I’m pretty sure that there isn’t a location parameter at the moment. Might be an idea to ask Lumis if that is possible though 😉 Not too sure how difficult that would be though.
Glad the File extension is working well for you 😊
Best wishes,
Mark
Thanks Mark, I’ve pm’d him to see what’s possible.
One more question:
I’ve got a page with multiple images that are being resized with the plugin. Each one of the images is a thumbnail that should link to a larger version of the image. I’m using a bit of jQuery for a lighbox type effect that needs the url of the image to fire up.
I’ve gone through the docs and can use a tag pair to pull out the url for the link (due to the double quotes thing), and have the following code working fine:
{exp:imgsizer:size image="{main_photo}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo}" width="80"}</a>
But what I’d like to do is:
<ul>
<li>{exp:imgsizer:size image="{main_photo}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo}" width="80"}</a></li>
<li>{exp:imgsizer:size image="{main_photo2}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo2}" width="80"}</a></li>
<li>{exp:imgsizer:size image="{main_photo3}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo3}" width="80"}</a></li>
</ul>
What happens is the first link is fine, but the image is missing, then the other images are all blown up to 500px wide.
Is there something about only having one tag pair on a page? Or is there something that needs resetting after the first tag pair?
Ha, that’ll teach me not to try some other experimentation.
I closed out each of the image sizer elements and all is right with the world.
This works:
<ul>
<li>{exp:imgsizer:size image="{main_photo}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo}" width="80"}{/exp:imgsizer:size}</a></li>
<li>{exp:imgsizer:size image="{main_photo2}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo2}" width="80"}{/exp:imgsizer:size}</a></li>
<li>{exp:imgsizer:size image="{main_photo3}" width="500"}<a href="http://{sized}" title="{title}">{/exp:imgsizer:size}{exp:imgsizer:size src="{main_photo3}" width="80"}{/exp:imgsizer:size}</a></li>
</ul>
Ben regarding your problem some more, I just did some testing on my own server and pointed the Image Sizer plugin to an incorrectly typed image path (absolute path) and nothing came up in the source code on my server so I am thinking that perhaps because of the way you have your server set up and utilising a hosts file (still don’t know what all that is about 😉 ) that maybe this is what is causing it. Do you possibly have a site online where you can test this out without any of the hosts files stuff as it might just be that the plugin can’t find the image due to that fact. Even if I tried using the just_check=”yes” or just_url=”yes” parameters on my server if I gave it an incorrect value for the src=”“ parameter then absolutely nothing comes up in the source. Just an idea though.
Hmmm, you might be right there. Didn’t think about it that way. Of course the URL works for me because I have the hosts file, but since it’s a server side thing and the server doesn’t have the host file it might be causing that. Interesting.
Thanks for the help.
Hi Ben,
Well hosts files are not really my thing either as you found out last night (well 3 in the morning my time 😉 ) but if I plug in a hard-coded image value to an Image Sizer tag on a site that I have it comes out fine but if I place in an incorrect image name then nothing comes out in the template at all just like what you are seeing so I am guessing this is what it might be.
As said I’ve never really had a problem with the plugin so hopefully it is just something like this. Hopefully when you go live you can convert across to the plugin as your page at the moment takes a while to load as it is loading in large images but then transforming them through the HTML to the correct size.
Hope you get it sorted soon.
Best wishes,
Mark
I’m having permissions issues, with all the cache/ folders being created by imgsizer.
I’m using it on my /uploads folder (777) so there’s no problem there, but I’m also using it on my regular images folder. Once the site is on the server the apache user is writing those cache dirs, but doesn’t have permission to.
So I thought the best thing would be to have the cachPath be absolute at just /assets/cache, but it appears that doesn’t work. I guess the you could have conflicting filenames and such when checking if a file exists.
Anybody have any ideas?
AJP - I’m pretty sure that would work, except that I might have like /assets/images/slideshow/ ..so I’d have to create a writable cache dir on the server everytime I add a subdirectory of my assets folder
I believe that’s correct, you’d need a cache folder for every directory where you’re going to be holding images.
AJP - Actually that’s the problem…I’m not talking about my uploads dirs, I’m talking about my sourced assets. I have LG Image/File Manager set up so you can insert and upload from /assets-public (writable) or just insert from /assets.
Made even more complicated by the fact that we’re using capistrano for deployment and git for SCM, which wont even acknowledge an empty folder as anything. :\
Makes my head hurt just thinking about it.
Other people have mentioned max size here but I can’t find an explanation for how to implement what I need. The auto setting won’t really work as the max width and max height I need are not the same
I need images to be sized in proportion with no cropping to a max-size of width=100px height=40px.
So a long landscape image might end up with a size of 100 x 20 while a long portrait image might end up 20 x 40 and a square image would end up 40 x 40
If you have problems with the plugin not outputting anything at all when you view source and are pretty sure you entered the right tags, created and changed the write perms to the cache dir and so on, you might want to make sure that the PHP variable $_SERVER[‘DOCUMENT_ROOT’] is working on you system.
It is in most cases, but not on all PHP configurations. If you don’t get any output just add:
$_SERVER['DOCUMENT_ROOT'] = '/system/path/to/webroot/';
at the top of the pi.imgsizer.php file on the line 2. Worked like a charm on one of the servers that I had trouble with.
(Or you could probably add this to some global file like path.php, as suggested above, but this is a quick and easy way to see if this is the problem…)
I’ve been doing a lot of multi-lingual sites lately, and I generally specify my custom fields as such:
{cf_product_description_{lg_lang}} which gets parse to {cf_product_description_en}
I’ve noticed that imgsizer doesn’t like variable variables like this. It’s not a problem to code a {if } block around it, but it’d be nice to know what the issue is. I’m assuming it’s a parse order issue.
Any thoughts?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.