2 of 17
2
plugin: Image Sizer
Posted: 18 October 2007 03:48 PM   [ Ignore ]   [ # 19 ]  
Grad Student
Rank
Total Posts:  83
Joined  03-01-2007

it would be really great if I could simply insert my image variable, like in the example below where I inserted my image as {image_big}... am I hearing that this is not possible?

IE:

{exp:imgsizer:size image="/images/uploads/{image_big}" width="50" alt="image"}

(above code does not work)

all I want to do is to produce a smaller version of my images in certain situations (ie., like some sort of “auto thumbnail”)

thx!

Profile
 
 
Posted: 18 October 2007 04:38 PM   [ Ignore ]   [ # 20 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  03-10-2005

ssouci
based on your earlier post the variable {image_big} is outputting

<img src="{filedir_1}carluccio_a_completemushroombook_200w.jpg" style="border: 0;" alt="image" width="200" height="250" />

and you are placing this in your template

{exp:imgsizer:size image=”/images/uploads/{image_big}” width=“50” alt=“image”}

so by combining {image_big} with the imgsizer plugin you are creating basically this tag

{exp:imgsizer:size image="/images/uploads/<img src="{filedir_1}carluccio_a_completemushroombook_200w.jpg" style="border: 0;" alt="image" width="200" height="250" />" width="50" alt="image"}

no that wont work

 Signature 

David Rencher
lumis.com
Image Sizer
eeFlickr
Photos

Profile
 
 
Posted: 18 October 2007 04:46 PM   [ Ignore ]   [ # 21 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6085
Joined  08-04-2002

That’s where ExtractURL-Plus comes in, it extracts just the image.ext from the {image_big} field.

Profile
 
 
Posted: 18 October 2007 05:10 PM   [ Ignore ]   [ # 22 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  03-10-2005

PXLated
yeah i understand that but i don’t think he was using that plug-in.
also to use a plug-in to set the param on a tag you need to use the parse=“inward” param


{exp:imgsizer:size image="/images-reading/{exp:extract_url_plus show="&#xf;i;lename.&#xe;x;tension"}{reading_imageFile}" width="150" alt="My Title" parse="inward"}

Related thread

 Signature 

David Rencher
lumis.com
Image Sizer
eeFlickr
Photos

Profile
 
 
Posted: 18 October 2007 05:24 PM   [ Ignore ]   [ # 23 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6085
Joined  08-04-2002

Sorry Lumis, I figured you understood, was directing that more to Ssouci…I should have specified :-(

Parse Inward…Hmmm, didn’t think of that. So used to using phpThumb where that doesn’t come into play. Thanks!

Profile
 
 
Posted: 22 October 2007 03:47 PM   [ Ignore ]   [ # 24 ]  
Grad Student
Rank
Total Posts:  83
Joined  03-01-2007

Lumis:

to answer your question, my image variables like this in the database:

EG:

<img src="{filedir_1}oliver_j_jamiesitaly_200w.jpg" style="border: 0;" alt="image" width="200" height="263" />

I am uploading my images into the images/uploads directory using EE’s bult-in uploader, and it seems that EE inserts the {filedir_1} variable (to replace the full path data)

thx

Profile
 
 
Posted: 22 October 2007 08:14 PM   [ Ignore ]   [ # 25 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  03-10-2005

ssouci
{filedir_1} could output anything depending on how you have it setup in your upload preferences. i believe it is “URL of Upload Directory” just set that to a relative path instead of a URL
http://www.domain.com/images/uploads/
to
/images/uploads/

but I updated the plug-in to deal with situations like this where someone would want to pass in the full URL. it will also now fetch remote images now and resize them.
give it a try and let me know

 Signature 

David Rencher
lumis.com
Image Sizer
eeFlickr
Photos

Profile
 
 
Posted: 23 October 2007 11:50 AM   [ Ignore ]   [ # 26 ]  
Summer Student
Avatar
Total Posts:  14
Joined  05-24-2007

lumis I was looking for a plugin like this.

I’ve readed the entire post and I’ve nothing more to say than a big THANK YOU for yor support.

Profile
 
 
Posted: 23 October 2007 01:06 PM   [ Ignore ]   [ # 27 ]  
Summer Student
Avatar
Total Posts:  14
Joined  05-24-2007

Well I’m having my first trouble with this plugin, and I think it’s because EE is installed inside a folder, not in the root folder.

My EE installation is in the directory /sitio/

So my templates are acceded like this

/sitio/index.php/template_group/template_name

I wrote the full image path instead of taking it from a variable just to be sure that the problem is not with the variables or how I’ve configured my upload dir.

The full image path is /sitio/images/covers/cod_83.jpg, so I wrote

{exp:imgsizer:size image="/sitio/images/covers/cod_83.jpg" width="170" justurl="yes"}

That returns nothing…

But if I use the path without the installation dir (without /sitio):

{exp:imgsizer:size image="/images/covers/cod_83.jpg" width="170" justurl="yes"}

The plugin returns the cached image URL, obviously without the installation dir:

/images/covers/cache/170x170-cod_83.jpg

So to fix that, I add the installation dir manually:

/sitio{exp:imgsizer:size image="/images/covers/cod_83.jpg" width="170" justurl="yes"}

So the plugin returns:

/sitio/images/covers/cache/170x170-cod_83.jpg

It looks like I’ve solved the problem, but there is another: The image cache file doesn’t exist.

There is no /cache folder inside my /covers folder.

Maybe is because the plugin is trying to write it in /images/coves instead of /sitio/images/covers.

The weird thing is that it seems like the plugin is adding the /sitio folder to the image path, because it can find it and read it well, but it’s not able to write it to the correct destination folder.

Any Help?

Profile
 
 
Posted: 26 October 2007 10:47 AM   [ Ignore ]   [ # 28 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1735
Joined  03-26-2006

Has this plugin been updated so that height is the determining factor in the resize? I have a layout where I really need to restrict by height - but everywhere else on the site I need to restrict by width, which this apparently does. I’d hate to have to install this for everything but that one page, where I’d have to install phpThumb just to restrict by height.

Thanks for working on a simple(r) alternative to phpThumb, which is, in many case, overkill.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 31 October 2007 03:34 PM   [ Ignore ]   [ # 29 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  184
Joined  10-24-2006

Hi there - Looks like a great plugin!

We’re currently using PhpThumb to resize images, and it’s killing our server when we get too much traffic.  Is this plugin more efficient than PhpThumb?

Thanks again!

 Signature 

Dabbledoo Media

———————————————————————-
Gadgetell - Tech News and Reviews
Gamertell - Gaming Hardware and Product News
Appletell - Apple News and Rumors

Profile
 
 
Posted: 31 October 2007 04:49 PM   [ Ignore ]   [ # 30 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  03-10-2005

updated v1.5

* now uses Expression Engines Image Library instead of just the GD library so any image processor setup in the EE control panel will work.
* resizing can be done by ether width or height
* images keep there default format instead of all being converted to jpg
* mime type check makes sure mime types match ok types
* combined the tag pair into the default tag so it can be a tag pair or a single depending on how you want the output
* the pathing to the image location is now based on server vars and not relative paths
* cache directory is created automatically if it is not on the server

src= (required) the path from “webroot” to the image or the URL to the image
  /images/news/moped.jpg or http://www.lumis.com/images/news/moped.jpg

width= the width you wish the image to resized to. the height is resized proportionately
    or
height= the height you wish the image to resized to. the width is resized proportionately
    note: if you use width and height width will take president

justcheck
= (Single Tag only) if set to yes the tag will return a 1 if the image exists
justurl= (Single Tag only) if set to yes the tag will only return the path to the image
alt= (Single Tag only) the alt tag of the image
id= (Single Tag only) the id of the image

 

Single Tag:

{exp:imgsizer:size src="/images/news/moped.jpg" width="200" alt="My Title" id="img_5334" class="entry_img"}
          will output
         
<img src="/images/news/cache/200x134-moped.jpg" width="200" height="134" alt="My Title" class="entry_img" id="img_5334" />

Tag Pair:

{exp:imgsizer:size src="/images/news/moped.jpg" width="100"}
       
<img src="{url}" width="{width}" height="{height}" />
       <
div style="background-image:url({url}); width:{width}px; height:{height}px;"></div>
  
{/exp:imgsizer:size}

 Signature 

David Rencher
lumis.com
Image Sizer
eeFlickr
Photos

Profile
 
 
Posted: 31 October 2007 05:49 PM   [ Ignore ]   [ # 31 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6085
Joined  08-04-2002

Wow Lumis, you’ve been busy!!! Will be trying it out as soon as I get a break.

Profile
 
 
Posted: 31 October 2007 09:28 PM   [ Ignore ]   [ # 32 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  717
Joined  07-02-2007

Man somebody was busy smile

I still wonder if you could use this on a very busy site, if there are no performance issues.

 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 October 2007 10:12 PM   [ Ignore ]   [ # 33 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6085
Joined  08-04-2002

I would imagine it would have the same issue as phpThumb if it has to check for a cache file on every page load. It would probably have to in case you’ve changed a parameter.

Profile
 
 
Posted: 31 October 2007 10:20 PM   [ Ignore ]   [ # 34 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  03-10-2005

well it would depend on what your idea of busy is? but i use it here with no problems http://wkrg.com/ every article we do has multipul different image sizes. and i cant give out exact numbers but it handels well over a million page views a month. and at peek times over 6000 users on the site at one time.

I have also built Gallery sections using this plug-in you can view here   http://wkrg.com/weather_gallery/

I have a companion plug-in im working on to display images in the edit list and resizing / cropping tab in the publish page

ohh and the check cache feature is a simple if cache file exists then dont do any processing and just return the url

 Signature 

David Rencher
lumis.com
Image Sizer
eeFlickr
Photos

Profile
 
 
Posted: 31 October 2007 10:29 PM   [ Ignore ]   [ # 35 ]  
Summer Student
Avatar
Total Posts:  14
Joined  05-24-2007
PXLated - 31 October 2007 10:12 PM

I would imagine it would have the same issue as phpThumb if it has to check for a cache file on every page load. It would probably have to in case you’ve changed a parameter.

Does that really have performance issues?

I’ll try the new version in a website, It has had about 18000 template hits in the last two weeks. And I have the template cache activated.

Will the plugin slow down the website?
What if I just use the justurl parameter (obviously after the image has been resized and cached)?
Does EE have any method to save the plugin’s output in the cache? Or any way to notice the plugin in case EE is using a cached version of a template?

Sorry for my english smile

lumis, thank you again for the great support you are givin to this plugin!

Profile
 
 
Posted: 31 October 2007 10:38 PM   [ Ignore ]   [ # 36 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6085
Joined  08-04-2002

With phpThumb it’s been reported by a couple as slowing down their site but only where there are tons of images on each page so it’s making the cache call many times over. And the speed comparison is in relation to using standard static thumbs rather than dynamic. I haven’t heard any problems for normal sites with a small number of images per page.

Profile
 
 
   
2 of 17
2
 
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: 39
Total Topics: 82116 Total Anonymous Users: 18
Total Replies: 441307 Total Guests: 199
Total Posts: 523423    
Members ( View Memberlist )
Newest Members:  meenoiYang.JianuoioitsukiNathan HammondalexcigadamstaneckiLucas Mayscybermilltstitt