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

PXLated's avatar
PXLated
1,800 posts
17 years ago
PXLated's avatar PXLated

The problem I’m having is very similar to ssouci…

The custom field contains (standard insert through the EE file upload button) … < img src=”https://ellislab.com/asset/images/pronet-logo/1591399270.jpg” width=”473” height=”700” / >


Beyond that, one can use other plugins to extract or convert that field data…

ExtractURL will take that custom field and return the full path…

http://media.pmhclients.com/images-reading/0609810316.jpg

ExtractURL-Plus has parameter so you can extract just the file name so you’d get… 0609810316.jpg


What I do when using phpThumb is use the second within the phpThumb code…That gets me a cached thumbnail…

http://www.site.com/utilities/phpThumb/phpThumb.php?src=/images-reading/{exp:extract_url_plus show=

For Image resizer to work for this scenario, it would either have to convert the file/path like Extract-URL and use that or allow one to use either ExtractURL or ExtractURL-Plus within the tag. With the later, the code would look like this…

{exp:imgsizer:size image="/images-reading/{exp:extract_url_plus show="i;lename.x;tension"}{reading_imageFile}" width="150" alt="My Title"}
       
Erskine's avatar
Erskine
46 posts
17 years ago
Erskine's avatar Erskine

Hi there,

I’m having the same problem as rick.prince, but on a Unix server.

Both the single and pair tags aren’t outputting anything at all.

Any ideas? Really keen to use this as its a lot more streamline and tidier than phpThumb.

Cheers.

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

Sorry it is taking me so long to get back to you guys. but it is hard to tell whats going on with your setups if i cant see the input

basically the variables that you are putting in as the image, do they contain the full URL or just the relative path? Right now it has to be the path from your sites http root to the image.

for instance this will work. /images/uploads/image.jpg

this will not work.

however the new version i am working on will do images with full URL’s i will possibly have a update today

       
ssouci's avatar
ssouci
70 posts
17 years ago
ssouci's avatar ssouci

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!

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

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

https://ellislab.com/asset/images/team-photo/carluccio_a_completemushroombook_200w.jpg

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/https://ellislab.com/asset/images/team-photo/carluccio_a_completemushroombook_200w.jpg" width="50" alt="image"}

no that wont work

       
PXLated's avatar
PXLated
1,800 posts
17 years ago
PXLated's avatar PXLated

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

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

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="i;lename.x;tension"}{reading_imageFile}" width="150" alt="My Title" parse="inward"}

Related thread

       
PXLated's avatar
PXLated
1,800 posts
17 years ago
PXLated's avatar PXLated

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!

       
ssouci's avatar
ssouci
70 posts
17 years ago
ssouci's avatar ssouci

Lumis:

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

EG:

https://ellislab.com/asset/images/team-photo/oliver_j_jamiesitaly_200w.jpg

I am uploading my images into the images/uploads directory using EE’s bult-in uploader, and it seems that EE inserts the https://ellislab.com/asset/images/team-photo/ variable (to replace the full path data)

thx

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

ssouci https://ellislab.com/asset/images/team-photo/ 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

       
Gonzalingui's avatar
Gonzalingui
13 posts
17 years ago
Gonzalingui's avatar Gonzalingui

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.

       
Gonzalingui's avatar
Gonzalingui
13 posts
17 years ago
Gonzalingui's avatar Gonzalingui

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?

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

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.

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

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!

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

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
         /images/news/cache/200x134-moped.jpg

Tag Pair:



						
       
1 2 3 4 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.