14 of 17
14
plugin: Image Sizer
Posted: 18 July 2008 07:05 AM   [ Ignore ]   [ # 235 ]  
Summer Student
Total Posts:  4
Joined  05-07-2008

Thanks for the update.  Here is my new debug information:

src = /gm/ee/images/feature_photos/secs_state-24414-381_575.jpg
    img_base
= /gm/ee/images/feature_photos
    img_basename
= secs_state-24414-381_575.jpg
    img_extension
= jpg
    img_filename
= secs_state-24414-381_575
    img_rootstep
= /usr/local/apache/htdocs//gm/ee/images/feature_photos
    
img_rootpath =
    
img_fromroot = /secs_state-24414-381_575.jpg
            

/secs_state-24414-381_575.jpg is not readable

I am using

{exp:imgsizer:size src="{feature_photo}" width="200" height="100" alt="{feature_photo_cutline}" title="{title}" debug="1"}


to call the plugin.

Still not working, but hopefully this will narrow down the problem.  I already tried to remove the double “//” in img_rootstep, but that still did not work.  Thanks for your persistence in helping to get this working on my site.

Profile
 
 
Posted: 18 July 2008 07:21 AM   [ Ignore ]   [ # 236 ]  
Summer Student
Total Posts:  4
Joined  05-07-2008

I just figured out that $img_rootstep is calling the wrong path.  It should call “/usr/www/gm/public_html/ee/images/feature_photos”.  Instead it is calling “/usr/local/apache/htdocs//gm/ee/images/feature_photos” I was able to get a resized image hard-coding the path.  Is there any way to make the plugin call “/usr/www/gm/public_html/ee/images/VARIABLE_IMAGE_DIRECTORY”?  I have limited PHP knowledge, but it seems like it should be pretty simple. This is going to be an invaluable plugin for my site…so glad I’m getting it to work!

Profile
 
 
Posted: 18 July 2008 12:40 PM   [ Ignore ]   [ # 237 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  03-10-2005

I would imagine that {feature_photo} is coming from a {filedir_1} like variable in your publish page?

the filedir variable is set by your “URL of Upload Directory” in the Control Panel
CP Home › Admin › Weblog Administration › File Upload Preferences › Edit File Upload Preferences

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 “/usr/local/apache/htdocs//gm/ee/images/feature_photos”
would look for the photo at this location after it removes the double slashes
“/usr/local/apache/htdocs/gm/ee/images/feature_photos/secs_state-24414-381_575.jpg”

so try changing your file upload preferences to be
Server Path to Upload Directory = “../images/feature_photos/”
URL of Upload Directory = “images/feature_photos/”

 Signature 

David Rencher
lumis.com
Image Sizer
eeFlickr
Photos

Profile
 
 
Posted: 19 July 2008 01:44 AM   [ Ignore ]   [ # 238 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  571
Joined  10-14-2005

Hi David (and others!) I’ve just come up against an unusual problem. I had the imgsizer plug-in installed and all was working well. I’ve since made a few changes to my set up, installed CURL on the server and installed the eeFlickr Module. Because of some problems elsewhere I have also cleared the EE cache both via the CP and manually.

Shortly after this I noticed that wherever I was using the imgsizer plugin that nothing was being displayed, no img tag at all. So I added debug=“1” to the params and I get back:

/photo_1.jpg is not readable

This is odd because I have done a sanity check, the image ‘is’ there and even when I hard code the URL I have the same problem. I have even tried turning off caching. I did wonder if I had somehow inadvertently not included GD in the PHP build when I installed CURL but PHP info is reporting it as available (http://wiredin.org.uk/test.php).

Any ideas?

*Update* Having read back a few posts I see that I’m having the very same problem as others here and will try the latest build with the extra debug info. smile

 Signature 

Nathan Pitman

Nine Four Ltd - a member of the EEPro Network

Profile
 
 
Posted: 19 July 2008 02:27 AM   [ Ignore ]   [ # 239 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  571
Joined  10-14-2005

Ok, very odd. I downloaded the revised plug-in and installed it. Was distracted for 30 mins or so, came back and all is good. smile

 Signature 

Nathan Pitman

Nine Four Ltd - a member of the EEPro Network

Profile
 
 
Posted: 20 July 2008 08:06 PM   [ Ignore ]   [ # 240 ]  
Lab Assistant
RankRank
Total Posts:  142
Joined  01-20-2008

Hi David,

I turned the debugging on and have discovered that the img_rootstep is wrong (output below).
It should be /something/web/mac/images/alumni/profiles.

I read what you advised for Derek, but that won’t work for me because our images aren’t uploaded to the file upload area. We have a photo gallery set up and then use a relationship field in EE to link to the picture.

Eg:

{related_entries id="profile_img"}
                       {exp
:imgsizer:size src="{image_url}" width="50px" height="50px" alt="{caption}" title="{title}" debug="1"}
              {
/related_entries}



  src = /mac/images/alumni/profiles/Veamatahau_Adrian_72.jpg
  img_base = /mac/images/alumni/profiles
  img_basename = Veamatahau_Adrian_72.jpg
  img_extension = jpg
  img_filename = Veamatahau_Adrian_72
  img_rootstep = /something/web/alumni//mac/images/alumni/profiles
  img_rootpath =
  img_fromroot = /Veamatahau_Adrian_72.jpg
       

/Veamatahau_Adrian_72.jpg is not readable

Profile
 
 
Posted: 21 July 2008 10:45 AM   [ Ignore ]   [ # 241 ]  
Summer Student
Total Posts:  4
Joined  05-07-2008

I was able to solve my problem today. Hopefully this will help some others who were having the same problem.

The first step was to re-assign the DOCUMENT-ROOT in EE’s path.php file. (Thank you mdesign - see post). I added the following to the CONFIGURABLE VARIABLES:

$global_vars =
array(
$_SERVER['DOCUMENT_ROOT'] = '/usr/www/gm/public_html'
);

Because my install is in a subfolder, img_rootstep was then calling:

/usr/www/gm/public_html//gm/ee/images/feature_photos

I needed to remove the “/gm” after “public_html” in order to get the plugin to find the correct path.

Back in pi.imgsizer.php, I had to make a slight adjustment to the code at line 158.  I created a new variable from $img_base called $img_base_edit which removed the first 3 characters from the string (/gm).  Then, in the following line, I changed $img_base to the new variable $img_base_edit.

$img_base_edit = substr($img_base, 3);
$img_rootstep = $img_rootstep.'/'.$img_base_edit;

Everything seems to be working fine now.

Profile
 
 
Posted: 24 July 2008 10:28 AM   [ Ignore ]   [ # 242 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  04-21-2008

Hello and thanks for this great plug-in!

Is there a reason why

greyscale="yes"

is not working on my side? Is there anything I would be doing wrong with this parameter?!

 Signature 

Good Design is What Good Business is all About!

Profile
 
 
Posted: 25 July 2008 03:19 AM   [ Ignore ]   [ # 243 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  04-21-2008

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?

 Signature 

Good Design is What Good Business is all About!

Profile
 
 
Posted: 29 July 2008 08:29 PM   [ Ignore ]   [ # 244 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  02-26-2004
lumis - 18 July 2008 12:40 PM

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.

Profile
 
 
Posted: 30 July 2008 04:22 PM   [ Ignore ]   [ # 245 ]  
Summer Student
Total Posts:  18
Joined  06-13-2005

Just wanted to post a very quick reply to say GREAT BIG THANKS for writing this plugin!

This will replace a lot of cumbersome code I have written in the past…

Profile
 
 
Posted: 30 July 2008 07:29 PM   [ Ignore ]   [ # 246 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1593
Joined  01-05-2007

Hey Lumis, any chance of getting this to play nice with Extract URL or doesn it not work like this -

{exp:imgsizer:size src="{exp:extract_url}{artists_works_piece}{/exp:extract_url}" width="140" alt=""}

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 30 July 2008 08:06 PM   [ Ignore ]   [ # 247 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  717
Joined  07-02-2007

You can add parse=“inward” to imgsizer OR use this code:

{exp:extract_url:precise}
    {field}
    {exp
:html_strip keep="img"}{body}{/exp:html_strip}
    {
/field}
    {exp
:imgsizer:size src="{eu_url}" width="140" alt=""}
{
/exp:extract_url:precise}

‘extract_url’ and ‘html_strip’ are plugins

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
Super Cache (Cache heavy tag output)
reCAPTCHA Extension
Rewrite Module


See all my EE Addons (8)

Profile
 
 
Posted: 30 July 2008 08:15 PM   [ Ignore ]   [ # 248 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1593
Joined  01-05-2007

So this should work?

{exp:imgsizer:size image="{exp:extract_url}{artists_works_piece}{/exp:extract_url}" width="140" alt="{title} {gallery_year}" parse="inward"}

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 30 July 2008 08:22 PM   [ Ignore ]   [ # 249 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  717
Joined  07-02-2007
stinhambo - 30 July 2008 08:15 PM

So this should work?

{exp:imgsizer:size image="{exp:extract_url}{artists_works_piece}{/exp:extract_url}" width="140" alt="{title} {gallery_year}" parse="inward"}


“Should” work..

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
Super Cache (Cache heavy tag output)
reCAPTCHA Extension
Rewrite Module


See all my EE Addons (8)

Profile
 
 
Posted: 30 July 2008 08:26 PM   [ Ignore ]   [ # 250 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1593
Joined  01-05-2007

Nope it doesn’t :(

parse=“inwards” doesn’t seem to be listed on the plugin site page now.

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 31 July 2008 10:30 AM   [ Ignore ]   [ # 251 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  717
Joined  07-02-2007
stinhambo - 30 July 2008 08:26 PM

Nope it doesn’t :(

parse=“inwards” doesn’t seem to be listed on the plugin site page now.


Then try my other suggestion that does work

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
Super Cache (Cache heavy tag output)
reCAPTCHA Extension
Rewrite Module


See all my EE Addons (8)

Profile
 
 
Posted: 31 July 2008 10:34 AM   [ Ignore ]   [ # 252 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1593
Joined  01-05-2007

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?

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
   
14 of 17
14
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65026 Total Logged-in Users: 42
Total Topics: 82116 Total Anonymous Users: 17
Total Replies: 441307 Total Guests: 186
Total Posts: 523423    
Members ( View Memberlist )
Newest Members:  meenoiYang.JianuoioitsukiNathan HammondalexcigadamstaneckiLucas Mayscybermilltstitt