I actually found what’s going on:
If say - I have:
{exp:imgsizer:size src="{image_url}" width="100"}
…then later if I decide to have a grayscale version of the same image - the above code won’t return a grayscale unless cache is set to “yes” - which will replace already cached (colored) images from the very first code.
thus, having:
{exp:imgsizer:size src="{image_url}" width="100" greyscale="yes" cache="yes"}
this WILL return a greyscale…
then you can remove cache=”yes”…
I guess a good way to “fix” the greyscale parameter, would be for it to create a chached version of the same image with a ‘x’ letter added to it. In other words: greyscale parameter creates cached version in the following matter - rotarylogo-80x80g.jpg (adding the letter ‘g’ at the end of the filename - this way you don’t have to fiddle with the cache=”yes/no” parameter.
…agree?
the way i have it setup is so the paths are relative to my install of EE for instance Server Path to Upload Directory = “../images/uploads/” URL of Upload Directory = “images/uploads/” as you can see in the error output img_rootstep i am appending the input to the src= to the root directory of your htdocs so try changing your file upload preferences to be Server Path to Upload Directory = “../images/feature_photos/” URL of Upload Directory = “images/feature_photos/”
Hi Lumis. Thanks for the great plug-in! Thanks also to those of you trying to resolve server path issues…
Lumis’ above advice was useful, but I am using a university server for the first time for a new site. I also get the ‘image not readable’ error.
You access us from a URL with the dreaded tilde.
http://www.arts.university.ca/~ourfolder
I guess this is something like running in a subdirectory, but if I try to mess with the configurable variables in path.php I get an error no matter what I change it to. Perhaps because we are in a folder within a subdomain? Ugh.
The server path to my web directory is thus like this:
/Users2/ourfolder/web-docs/
and the file upload folder
/Users2/ourfolder/web-docs/img/events/
Rather than this folder, /Users2/ourfolder/web-docs/img/events/, it wants to produce
src = /~ourfolder/img/events/solguy.jpg
img_base = /~ourfolder/img/events
img_basename = solguy.jpg
img_extension = jpg
img_filename = solguy
img_rootstep = /usr/local/apache2/htdocs///~ourfolder/img/events
img_rootpath =
img_fromroot = /solguy.jpg
If I try to make my server paths to the file upload folder relative to the EE folder, as Lumis has described above, I get
src = img/events/solguy.jpg
img_base = img/events
img_basename = solguy.jpg
img_extension = jpg
img_filename = solguy
img_rootstep = /usr/local/apache2/htdocs//img/events
img_rootpath =
img_fromroot = /solguy.jpg
If I try Derek’s touch-up to the code, I seem to get an even longer string in img_rootstep… ugh, I think I need to go and look at the paths with fresh eyes tomorrow.
I assume that if I use the custom fields from my template and utilise your example I get -
{exp:extract_url:precise}
{field}
{exp:html_strip keep="img"}{artists_works_piece}{/exp:html_strip}
{/field}
{exp:imgsizer:size src="{artists_works_piece}" width="140" alt=""}
{/exp:extract_url:precise}
What is the {field}{/field} tag pair?
This didn’t work I’m afraid.
Here is the code I used -
{exp:extract_url:precise}
{field}
{exp:html_strip keep="img"}{artists_works_piece}{/exp:html_strip}
{/field}
{exp:imgsizer:size src="{eu_url}" width="140" alt=""}
{/exp:extract_url:precise}
Anything I’m doing wrong here?
@ lumis I love this plugin and have used it lots & lots. It’s amazing.
I’m currently tryin to use it on my own site but it isnt working, see http://www.paulcripps.com/index_ee.php
This doesnt work {fav_img_url} is a custom filed containing https://ellislab.com/asset/images/ent-partner-logo/test.jpg… the tag is as follows: {exp:imgsizer:size src="{fav_img_url}” width=”445” alt=”{title}” debug=”1”}
I hard code the url it works fine: {exp:imgsizer:size src="http://www.paulcripps.com/images/uploads/favs/test.jpg" width="120" alt="{title}” }
So it looks like its a server thing, any thoughts on the errors and how to fix?
Hmm rather strangely I appear to have run into the same problem as Paul!
None of these work: {exp:imgsizer:size src="images/site/project-blank.png" width="270" height="100" alt="test"} {exp:imgsizer:size src="/images/site/project-blank.png" width="270" height="100" alt="test"} {exp:imgsizer:size src="{site_url}images/site/project-blank.png” width=”270” height=”100” alt=”test”} {exp:imgsizer:size src="{site_url}/images/site/project-blank.png” width=”270” height=”100” alt=”test”}
This works: {exp:imgsizer:size src="http://example.com/v2/images/site/project-blank.png" width="270" height="100" alt="test"}
{site_url} outputs “http://example.com/v2/”
Any Idea what is up?
What is strange is I also more hosting on the the same shared server and it’s working fine on that other site, only difference is that I have a htaccess rule to remove the www part of the url.
edit here is some debug info:
src = images/site/project-blank.png
img_base = images/site
img_basename = project-blank.png
img_extension = png
img_filename = project-blank
img_rootstep = /home/user/public_html/images/site
img_rootpath = /home/user/public_html/images/site
img_fromroot = /home/user/public_html/images/site/project-blank.png
The above misses out the fact it is in a sub directory called V2…
src = <img src="http://example.org/v2//images/site/project-blank.png" alt="" />
img_base = http://example.org/v2//images/site
img_basename = project-blank.png
img_extension = png
img_filename = project-blank
img_rootstep = /home/user/public_html/http://example.org/v2//images/site
img_rootpath =
img_fromroot = /project-blank.png
This add a double slash to the rootstep, and im not sure if the domain should be their either
what does {fav_img_url} output if you put it in the template outside of the image sizer plugin?
The output is, as you would expect: /images/uploads/favs/test.jpg In admin I set the URL of Upload Directory to both
1 - /images/uploads/favs/ 2 - http://www.paulcripps.com//images/uploads/favs/
The output error I get from image sizer plugin is :
src = //www.paulcripps.com/images/uploads/favs/test.jpg
img_base = //www.paulcripps.com/images/uploads/favs/test.jpg <
img_basename = p>
img_extension =
img_filename = p
img_rootstep = /content/DesignerPlus/p/a/www.paulcripps.com/web///www.paulcripps.com/images/uploads/favs/test.jpg <
img_rootpath =
img_fromroot = /p.
/p. is not readable
You can see it here: http://www.paulcripps.com/index_ee.php/Home/image-resizer/
Any ideas, Im not great with servers php so sorry if its obvious?!!
Lumus,
As previous posts my de-bug info can be seen here: http://www.paulcripps.com/index_ee.php/Home/image-resizer/
Excuse my ignorance here but here a few thoughts. Could we pass the parameter to the path where the folder is? Only reason I say this is my custom field works fine, the image is uploaded and I can view it. So the problem is a server based path problem surely passing the exact path would work (as I say excuse my ignorance).
So:
{exp:imgsizer:size src="{my_custom_field_with_image_name_in}" width="140" img_root="http://www.paulcripps.com//images/uploads/favs/"}
I installed the EE gallery last night and that works fine giving me the desired result as you can see here: .(JavaScript must be enabled to view this email address) Though I would prefer to use the plugin: Image Sizer to give me a little more flexibility.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.