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

plugin: Image Sizer

Development and Programming

Dabbledoo's avatar
Dabbledoo
172 posts
17 years ago
Dabbledoo's avatar Dabbledoo

bump (sorry to be annoying) - does anyone have any thoughts on my question? We’re riding without any images because phpThumb is crashing our server with high traffic.

I appreciate your help.

-Doug

       
timkelty's avatar
timkelty
177 posts
17 years ago
timkelty's avatar timkelty

I can’t figure out why I can’t get the tag pair to work….

This works fine:

{exp:imgsizer:size src="{product_image}" auto="126"}

When I try to use this…

{exp:imgsizer:size src="{product_image}" auto="126"}
{url}
{/exp:imgsizer:size}

I get an <img> tag with the right width and height, but the src= is empty. I checked in the cache folder and it is generating the thumbnails, I just can’t get it to spit the {url} back out when I use the tag pair.

I also tried debug=”1” and the outpaths are the correct paths for the resized images…its just that {src} isn’t displaying anything

Any ideas?

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

New Version 1.6 - added Square sizing. it is triggered when the width and the height are set the same. - added an alternative for the {url} variable you can use {sized} if {url} is clashing with a custom field you may have set.

you can download here .

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

This is one of my favorite must-install-on-every-site plugins. Thanks for the updated version, Lumis.

       
Dabbledoo's avatar
Dabbledoo
172 posts
17 years ago
Dabbledoo's avatar Dabbledoo

We have multiple domains using the same EE install, and are having issues with the plugin on those other domains. Do you have an suggestions of how to get it working on a different domain hosted on the same server? I tried making a symbolic link to the other domain, but it’s still not working. Any other ideas? Lumis?

Thanks again,

Doug

       
reyn's avatar
reyn
17 posts
17 years ago
reyn's avatar reyn

This looks like it may be just what I want, if only I could work out how to do what I want. Below is the code I use for thumbnails using phpthumb which works fine with just four or five images, over this it really slows down. Is there any way I could try Image Sizer using this type of syntax. I have tried but cannot get it to work.

<div class="thumbs"><a href="http://{id_path={gallery_template}/category/}{category_id}/{segment_5}">_ <img src="/ksys/templates/kuckoo_tmpl/gallery/phpthumb/phpThumb.php?src=/images/_{gallery_folder}/{cat_folder}/{filename}&w=100&h=100&zc=1&fltr;[]=usm|80|0.5|3" alt=""  /></a>
</div>

Thanks Frank

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

Frank, it should be something like this:

<div class="thumbs"><a href="http://{id_path={gallery_template}/category/}{category_id}/{segment_5}">_{exp:img_sizer src="/images/{gallery_folder}/{cat_folder}/{filename}" width="100" height="100" class="gallerythumb" alt="{title}"}</a>
</div>
       
reyn's avatar
reyn
17 posts
17 years ago
reyn's avatar reyn

Erin - Thank you I got it to work with:

<div class="thumbs"><a href="{id_path={gallery_template}/category/}{category_id}/{segment_5}">
{exp:imgsizer:size src="/images/{gallery_folder}/{cat_folder}/{filename}" width="100" height="99" class="gallerythumb" alt="{title}"}
</div>

The plugin seems to work much faster than phpthumb but I still have a few problems. The thumbs require some unsharp mask to improve the quality. When equal width and height are selected as stated the plugin selects the area from the center of the main image, I end up with a lot of thumbs that are all sky or cannot be recognised as the main image, I also do not get clear thumbs for some images at this setting. To get over this I have set the width to 100 and the height to 99 nearly square and that seems fine. I don’t want to seem churlish as it is a fine plugin and most welcome. I will try to put up a demo to show what I mean a bit more clearly. Thank you to David for the plugin and Erin for the help.

Frank

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

Let me take a look at the code to see if I can see why the equal lengths aren’t working.

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

OK, with equal values it crops the image with EE’s built-in image library. With all other settings it just changes the width or height as specified and doesn’t crop. That is why your 100/99 solution works.

It looks like to make this work, you should crop your images ahead of time, then use the ‘auto’ setting to make the image the correct size.

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

Dabbledoo Im not really sure what can be done with your issue considering there are different document roots for the image paths. I talked to a friend of mine that knows allot more about symbolic links than i do. and he recommended making sure the “user” that is running the host for siteA has permissions to the images on “siteB”

the only other thing i could do is modify the code so you could pass the {filedir_x} to the plug-in so it would have the full system path. but i would rather not do this because it just ads more code to keep up with.

Frank when the width and height are equal it will crop off the excess on the longest side from the “center x or y” (portrait or landscape) then size the image to the given square if you don’t want it to be a square only pass the width or height use auto=

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

Frank, i have added Unsharp Mask to the plug-in it only fires if your ExpressionEngine CP image sizing preferences are set to use GD2.

       
Martin Berglund's avatar
Martin Berglund
9 posts
17 years ago
Martin Berglund's avatar Martin Berglund
For some reason, I’m not getting this to work with an IP based address that looks like this: http://555.555.555.555/~username/ The images aren’t appearing, and nothing shows up in the source. I’ve tried the plug-in on a name-based URL, and that works, but not the IP-based site.

I have tested the same thing Eric. The plugin does not seem to work on my local setup. It works great online though.

Thanks for this great plugin! Is there any reason why it is not among the plugins in the downloads tab?

       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

This is looking really good and I’m ready to get rid of phpThumb although I’m not sure if it’s a limitation of the plugin or I’m missing something.

I’m using Mark Huots ‘File’ extension that allows me to upload multiple files and have them displayed with the following code:

{customfield}
{file_url}
{/customfield}

if I have four images this will output:

http://www.example.com/images/image1.jpg
<img src="http://www.example.com/images/image2.jpg" alt=""  />
<img src="http://www.example.com/images/image3.jpg" alt=""  />
<img src="http://www.example.com/images/image4.jpg" alt=""  />

Is there a way I can get the Image Sizer plugin to loop the src tag so it can display a number of thumbs?

There is no limit on the number of images I can upload with marks extension so hardcoding multiple imgsizer tags wouldn’t really work.

Any ideas?

In ‘theoryscript’ I am looking for something like:

{exp:imgsizer:size src="{customfield}{file_url}{customfield}" width="100" height="100" multiple="yes"}
               {sized}
 {/exp:imgsizer:size}

so say with a multiple=”yes” parameter and the tag pairs it would loop through the src and output 4 images thumbnailed to 100px by 100px.

I can then ditch phpThumb and ExtraxtURL.

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

Dane try it this way. This should just loop over the {file_url} and output each have not tried it but it should work like that.

{customfield}
        {exp:imgsizer:size src="{file_url}" width="100" height="100"}
                       {sized}
        {/exp:imgsizer:size}
    {/customfield}

Eric and Martin sorry for the delay on the IP based URL i will look into that tonight.

       
First 5 6 7 8 9 Last

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.