We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Trying to use imgsizer

Development and Programming

Marie-Jo Jones's avatar
Marie-Jo Jones
23 posts
16 years ago
Marie-Jo Jones's avatar Marie-Jo Jones

Thanks for your help and patience. My variable is clean and contains just the path images/uploads/pix/myimage.jpg. Nothing else. In fact, it would work OK if my EE installation was in the root of the site. But it’s not. It’s in a folder of the root. And the problem lies in the path.

By default, imgsizer takes the sitedomain as the base_path, i.e. mysite.com then it ads the base_cache path, by default, /images/sized/ I add my own path to the image, ie. /myfolders/myimage.jpg.

This gives mysite.com/images/sized/myfolders/myimage.jpg. Fine if ee is installed right under mysite.com. Otherwise, it doesn’t work. The eefolder is not in the path, which is my problem.

So I tried to change the base_path, to read not just mysite.com but mysite.com/myeefolder/. imgsizer provides an optional base_path=”” parameter.

base_path= (optional) by default the base_path is set by ExpressionEngine to your webroot you may override this by altering this value to something like “/web/htdocs/lumis.com/”

And I tried all the possible variations around: “/myhighestfolder/mysite.com/myeefolder/”, with parameters before or after the src. None of them worked and I don’t have access to such thing as “/web/htdocs/”. All I have is a folder containing mysite.com folder and several other sites. And note that the example given goes up in the hierarchy, not down…

Then I thought I should change the base-cache instead and have its path preceded by myeefolder/ to give: “/myeefolder/images/sized/” Again, I tried all possible combinations preceded or not by the base_path folder, with or without initial “, etc.

Can’t get it to work. Can’t think of alternative ways.

I surely missed something. what could it be?

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

base_path refers to your server path, not your URL path. An easy way to see this path, might be to look at Admin -> General Configuration, then look at “Theme folder path” - this is usually the full server path to the themes folder. In my case, that’s /home/<account>/public_html/. On a lot of shared hosting, it may just be “/www/htdocs/”.

This path points to your web root (where the root of your website begins). And relates to your folder names all the way - irrelevant of your domain name. In Lumis example, his domain is “www.lumis.com”, but the folder on his server that contains his root files is called “lumis.com”.

Out of interest are you using a .htaccess file to rewrite your paths?

It’s quite common to install EE in a subfolder, and from what you’ve told us thus far, the issue doesn’t look like it’s base_path or base_cache.

Funamentally, this works: “http://dedwyddjones.com/dsh01/images/uploads/pix/my_image.jpg” This doesn’t: {main_image_link} = “images/uploads/pix/my_image.jpg” “http://dedwyddjones.com/dsh01/{main_image_link}”

That’s what has thrown me. It should work for both or neither, not just one of them.

If “http://dedwyddjones.com/dsh01/images/uploads/pix/my_image.jpg” works when it’s resized to 50px, then there’s nothing wrong with your base_path and cache_path.

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

Sorry, you’ve got me hooked now and I don’t want to put this down unsolved!

I’ve got a test site set up in a sub folder

blah.com/ee-folder/

By default imgsizer doesn’t work. So added the following parameters for imgsizer:

justurl="yes" 
cache="no" 
base_path="/home/myhostingaccount/subdomains/root-of-domain/" 
base_cache="/home/myhostingaccount/subdomains/root-of-domain/ee-folder/images/sized" 
... size stuff...

This manages to display a broken image holder, and the html code is added to the page. But in theory base_path is incorrect as it doesn’t have the “ee-folder” folder specified.

Every other iteration of the paths (including not specifying each of them) doesn’t work - although if I set base_cache to equal base_path as shown above, the same happens - the html is output to a dead link. All other alternatives don’t output the html.

To make it more confusing, when it throws up the dead image link html it’s pointing here:

http://my.web.site/ee-folder/ee-folder/images/sized/ee-folder/images/content/ef75470efa1f18d26c21a80679ed14e4-blah-437x286.JPG

And on the server it creates the resized files successfully, but in a completely different folder…

/ee-folder/images/sized/ee-folder/images/content

So I’d say it’s a bug in imgsizer.

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

Ah poo.

I think we should start this thread again - What version of imgsizer are you using? It’s not v2.5.6 is it?

       
Marie-Jo Jones's avatar
Marie-Jo Jones
23 posts
16 years ago
Marie-Jo Jones's avatar Marie-Jo Jones
Funamentally, this works: “http://dedwyddjones.com/dsh01/images/uploads/pix/my_image.jpg”

Yes it does and did from the start perhaps because it finds a resized folder in images. Just a guess.

This doesn’t: {main_image_link} = “images/uploads/pix/my_image.jpg” “http://dedwyddjones.com/dsh01/{main_image_link}”

No, no http:// seems to be accepted when a variable or field is used.

If "http://dedwyddjones.com/dsh01/images/uploads/pix/my_image.jpg" works [b]when it's resized to 50px[/b], then there's nothing wrong with your base_path and cache_path.[/quote]

This is what throws me as well because at first hand it looked dead easy.

Thanks for your persistence. I’m sorry I’m not more reactive but there’s a big time gap. I’m in London +1 and I also need to spend time with my 88 year old Mum. So I have a very irregular timetable.

       
Marie-Jo Jones's avatar
Marie-Jo Jones
23 posts
16 years ago
Marie-Jo Jones's avatar Marie-Jo Jones
Ah poo. I think we should start this thread again - What version of imgsizer are you using? It’s not v2.5.6 is it?

Yes I’m using v.2.5.6, just installed it a few days ago. I’m fairly new to all this ‘tho’ I used EE in a very basic way some years back.

       
Marie-Jo Jones's avatar
Marie-Jo Jones
23 posts
16 years ago
Marie-Jo Jones's avatar Marie-Jo Jones
Sorry, you’ve got me hooked now and I don’t want to put this down unsolved! ]

Twobelowzero, I’m very grateful for your time and your persistence which is of the essence as my husband loves to say.

So I’d say it’s a bug in imgsizer.

It’s a consolation, I can tell you for all the time I tried to figure it out. I have lots of technical gaps but reasonably sharp analytical abilities and methods and I was wondering if I was going soggy. Mind you, it just happened straight after another 6 hours search for another problem I had so it was beginning to get me.

And on functionality, I thing imgsizer is interesting since it generates these light thumbnails without having to create a double set. Believe it or not, they uploaded pics 750 Mo heaby. With EE, they stay at this weight even in thumbnails. With imgsizer they’re reduced to less than 30 K.

Another great feature of imgsizer which I think is so wonderful for lessening the programming burden is the resizing from the center. Means you can throw up all your small pix without having to bother where they’re portrait or landscape. You just make squares and get away for 95% of the lot and as far as I’m concerned, it’s good enough (higher than Pareto’s).

So my hat to Lumis for bring us these functionalities. And I feel it’s worth the many hours I spent fiddling with it in despair if it can help him tighten it up.

End of the bla-bla-bla. It’s 1.30 am and I’m too worn out to analyze your technical info and try to reproduce it.

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

Lot’s of people have had issues with the pathing on v2.5.6, I’ve PM’ed you v2.5.5 which doesn’t have these issues. On my test site, it was using v2.5.6 hence why it was outputting the paths I mentioned above. When I uploaded v2.5.5 it worked first time.

Peter

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.