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

DougH's avatar
DougH
205 posts
16 years ago
DougH's avatar DougH

I’m attempting to use v2.5.5. of the imagesizer plugin for the first time.

I’m using this code:

{exp:imgsizer:size src="{photos_image}" width="200" alt="{title}"}

However, I keep getting the following error message:

Warning: mkdir() expects at most 2 parameters, 3 given in /.../plugins/pi.imgsizer.php on line 206

It’s evidently not able to create a cache directory.

Ideas?

update: I reverted to an older version still available at lumis.com and it seems to work fine.

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4

great plugin! I use it in all my projects!

but I still have some feature requests:

a rotate parameter a watermark parameter and the possibility to use { if} statements within the plugin tag.

cheers and thanks a ton stefan

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4
new version 1.3 now has what you want the original tag still works but i added this
{exp:imgsizer:pair image="/images/news/moped.jpg" width="200"}
    {url}
    {width}
    {height}
{/exp:imgsizer:pair}

this doesn’t seem to work anymore?! the pair thinggy… anybody knows?

       
ian Pitts's avatar
ian Pitts
175 posts
16 years ago
ian Pitts's avatar ian Pitts

I’m having a strange issue and hope someone has an idea…

Every time I hit a template that’s showing an imgsized image that hasn’t yet been cached, the template is empty. On Safari, I get the connection reset error message and I get a similar error in IE. FF just shows a blank page.

Reloading the page shows the content without error. I would normally be fine with that “resolution” but this will be going live in mere days on a production web site.

Any ideas?

       
ian Pitts's avatar
ian Pitts
175 posts
16 years ago
ian Pitts's avatar ian Pitts
this doesn’t seem to work anymore?! the pair thinggy… anybody knows?

I was able to use tag pairs with {exp:imgsizer:size} on a recent implementation without issue… other than the fact that the first call to a page with uncached resized images fails. Argh.

       
ian Pitts's avatar
ian Pitts
175 posts
16 years ago
ian Pitts's avatar ian Pitts

This is now becoming a huge issue for my site.

I’m using imgsizer to render smaller images from data that’s coming out of a FieldFrame Matrix via the nGen File Field.

When I use the default image paths when feeding imgsizer, I can’t get anything to display. If I build a full URL and turn the remote switch on, it works… but only on the second hit to the page.

The first time accessing a page with a resized image, EE stops processing with no errors and just fails. If I hit reload, it works for some undetermined amount of time.

Does anyone have any idea what’s going on?

You can see it (not) in action here: http://hybrid.mapinfogroup1.com/resources/sample-gallery/

(Try clicking on a featured sample, or a category view… or even drilling down to a detail. I’ve had trouble consistently reproducing the issue.)

       
Eastwood Design's avatar
Eastwood Design
605 posts
16 years ago
Eastwood Design's avatar Eastwood Design

I am having a tough time with this. I have a gallery of thumbnails using imgsizer to display the thumbs. That works great. Then I am trying to link to a larger version of the image on another template. The strange thing is when I click to view the larger image it works the first time I click. The second time I click on the thumb, or even a different thumb I get TWO images showing up in the parger version.

here is what I have on the gallery page (thumbnails)

{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="Gallery" }
           
<a href="http://{title_permalink={my_template_group}/gallery_detail}%22rel=%22facebox" rel="facebox" title="{title}">{exp:imgsizer:size_src="{Piece}" width="200" alt="{title}" class="thumb"}{/exp:imgsizer:size} </a>
<h2>{title}</h2>
      
 {/exp:weblog:entries}

That is linked to the gallery_detail template which has this to display the larger image

{exp:weblog:entries orderby="date" sort="desc" limit="1" weblog="Gallery" }
{exp:imgsizer:size src="{Piece}" width="600" alt="{title}" class="thumb"}{/exp:imgsizer:size}
 {/exp:weblog:entries}

How could I possible get 2 of the same images showing up in the detail template?

       
florian's avatar
florian
395 posts
16 years ago
florian's avatar florian

This may be an odd question. Is it correct, that the image sizer plugin ONLY creates the thumbnail if I enter the image sizer code in a expression engine template and then view that template through a browser? Lets say I want a 300px image created. I need to put that code in the template, and then when its viewed in the browser, the second image gets created and put in the cache folder. However, I need to create also a 75px image in addition to the 300px. Is it possible to create that image without having to load that code through the browser?? Right now I set up a temporary page with image sizer code 75px and I need to go to that page in order to create that thumbnail. I am using the 75px image for a jquery live search which is outside expression engine templates, so I cant really use the jquery pages to create the 75px image. I need to create the 75px image with expression engine templates/tag and then I can pull it in with the jquery. It is annoying to go that extra step though each time to load that temp page just to create the 75px image.

Sorry for the long post 😊 Just wondering if I could automate this..

thanks. Florian

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
16 years ago
Deron Sizemore's avatar Deron Sizemore

I’m wondering about how the plugin is supposed to work.

It says in the documentation:

if you use both width and height the image will be cropped from center to that width and height.

I’ve attached an image to show what I would expect to happen when cropped. Maybe someone can explain if that’s correct and if so why it’s not working for me.

The image I’ve attached is 400x337 and if I’ve set a width and height of 200x150 with image sizer, I wouldn’t expect it to resize the whole image, but “crop” it as it says in the docs from the center of the image. When I use imgsizer with a width and height, it simply resizes the whole image rather than crop it.

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

its late so forgive me if i am short

@iso100 if you use a tag pair on a specific template don’t use a single tag on the same template or vice versa

@Eastwood Design no need for the closing tag just remove it like below

{exp:weblog:entries orderby="date" sort="desc" limit="1" weblog="Gallery" }
{exp:imgsizer:size src="{Piece}" width="600" alt="{title}" class="thumb"}
{/exp:weblog:entries}

@florian one way i have done that is just to hide the output with eather JS or PHP comments

[removed]
//{exp:imgsizer:size image="/media/live/test.jpg" width="310" alt="" id="" justurl="yes"}
[removed]

now i have a image created that i can link to from somewhere else /images/sized/media/live/test-310x233.jpg

or you could just ping a template via URL with a cron job

       
bmulloy's avatar
bmulloy
4 posts
16 years ago
bmulloy's avatar bmulloy

this is a great plugin. thanks for sharing it.

i am using it to display the member photo for each author inline with the text. in order get the desired layout i am using align=”left”.

{if photo}
  {exp:imgsizer:size src="{photo_url}" width="100" cache="no" height="100" alt="{screen_name}'s photo" style="margin: 0px 10px 0px 0px;" align="left"}
{/if}

so, i added the style attribute in the same manner that class, alt, title, etc. were done in pi.imgsizer.php

here’s the diff

index 6256c04..14b4d7d 100644
--- a/editor/plugins/pi.imgsizer.php
+++ b/editor/plugins/pi.imgsizer.php
@@ -252,6 +252,7 @@ function do_output($img){
                
                $alt = ( ! $TMPL->fetch_param('alt')) ? '' : $TMPL->fetch_param('alt');
                $style = ( ! $TMPL->fetch_param('style')) ? '' : $TMPL->fetch_param('style');
+               $align = ( ! $TMPL->fetch_param('align')) ? '' : $TMPL->fetch_param('align');
                $class = ( ! $TMPL->fetch_param('class')) ? '' : $TMPL->fetch_param('class');
                $title = ( ! $TMPL->fetch_param('title')) ? '' : $TMPL->fetch_param('title');
                $id = ( ! $TMPL->fetch_param('id')) ? '' : $TMPL->fetch_param('id');
@@ -323,6 +324,8 @@ function do_output($img){
                        
                        $out_tag .= ($style ? " style=\"$style\"" : "");
                                                        
+                       $out_tag .= ($align ? " align=\"$align\"" : "");
+
                        return $out_tag." >";  
 
 }

thanks again for the great plugin. it was a huge time saver for me.

       
James Smith's avatar
James Smith
259 posts
16 years ago
James Smith's avatar James Smith

bmulloy - you’re much better off using the class parameter and then declaring float:left in your css - makes it much more future-proof. No one should be using presentational attributes like align=”” - The sooner they disappear the better!

J

       
bmulloy's avatar
bmulloy
4 posts
16 years ago
bmulloy's avatar bmulloy

thanks, James.

i did feel a little dirty doing that, but needed to get it deployed yesterday without the aid of my CSS guru. I’ll go back and look at it today.

best, -b

bmulloy - you’re much better off using the class parameter and then declaring float:left in your css - makes it much more future-proof. No one should be using presentational attributes like align=”” - The sooner they disappear the better! J
       
bobh's avatar
bobh
145 posts
16 years ago
bobh's avatar bobh

hi lumis, I’m having an issue with my cache dir path, I can’t set it to use /images/uploads/cache/.

when I use no base_cache and base_path parameters my cache directory is put outside of my uploads folder (which is bad for me):

/home/toasted/public_html/images/sized/images/uploads/

template debugging:

(0.086642) Calling Class/Method: Imgsizer/size
(0.086727) -> Class Called: Imgsizer
(0.086746) -> Method Called: size
(0.086788) imgsizer.user.src: /images/uploads/poster_toasted_junior_LR.jpg
(0.086832) imgsizer.img[src]: /images/uploads/poster_toasted_junior_LR.jpg
(0.086842) imgsizer.img[base_path]: /home/toasted/public_html/
(0.086861) imgsizer.img_full_path: /home/toasted/public_html/images/uploads/poster_toasted_junior_LR.jpg
(0.086999) imgsizer.img[base_rel_path]: /images/uploads/
(0.087058) imgsizer.full_pathinfo dirname: /home/toasted/public_html/images/uploads
(0.087069) imgsizer.full_pathinfo basename: poster_toasted_junior_LR.jpg
(0.087078) imgsizer.full_pathinfo extension: jpg
(0.087087) imgsizer.full_pathinfo filename: poster_toasted_junior_LR
(0.087370) imgsizer.Error: could not create cache directory! Please manually create the cache directory /home/toasted/public_html/images/sized/images/uploads/ with 777 permissions
(0.087388) Returning No Results Content
(0.087402) -> Data Returned

when I do use base_cache and base_path parameters the cache dir path is set to:

/home/toasted/public_html/images/uploads/cache/images/uploads/

template debugging:

(0.106085) Calling Class/Method: Imgsizer/size
(0.106135) -> Class Called: Imgsizer
(0.106150) -> Method Called: size
(0.106181) imgsizer.user.src: /images/uploads/poster_toasted_junior_LR.jpg
(0.106227) imgsizer.img[src]: /images/uploads/poster_toasted_junior_LR.jpg
(0.106237) imgsizer.img[base_path]: /home/toasted/public_html/
(0.106256) imgsizer.img_full_path: /home/toasted/public_html/images/uploads/poster_toasted_junior_LR.jpg
(0.106371) imgsizer.img[base_rel_path]: /images/uploads/
(0.106420) imgsizer.full_pathinfo dirname: /home/toasted/public_html/images/uploads
(0.106431) imgsizer.full_pathinfo basename: poster_toasted_junior_LR.jpg
(0.106440) imgsizer.full_pathinfo extension: jpg
(0.106450) imgsizer.full_pathinfo filename: poster_toasted_junior_LR
(0.106883) imgsizer.img[base_path]: /home/toasted/public_html/
(0.106894) imgsizer.img[src]: /images/uploads/poster_toasted_junior_LR.jpg
(0.106904) imgsizer.img[src_width]: 453
(0.106914) imgsizer.img[src_height]: 641
(0.106924) imgsizer.img[mime]: image/jpeg
(0.106933) imgsizer.img[base_rel_path]: /images/uploads/
(0.106944) imgsizer.img[root_path]: /home/toasted/public_html/images/uploads/
(0.106953) imgsizer.img[basename]: poster_toasted_junior_LR.jpg
(0.106963) imgsizer.img[extension]: jpg
(0.106972) imgsizer.img[base_filename]: poster_toasted_junior_LR
(0.106981) imgsizer.img[cache_path]: /home/toasted/public_html/images/uploads/cache/images/uploads/
(0.106990) imgsizer.img[crop]:
(0.107000) imgsizer.img[proportional]: 1
(0.107011) imgsizer.img[out_height]: 617
(0.107021) imgsizer.img[out_width]: 436
(0.107030) imgsizer.img[out_name]: poster_toasted_junior_LR-436x617.jpg
(0.107040) imgsizer.img[root_out_name]: /home/toasted/public_html/images/uploads/cache/images/uploads/poster_toasted_junior_LR-436x617.jpg
(0.107049) imgsizer.img[browser_out_path]: /images/uploads/cache/images/uploads/poster_toasted_junior_LR-436x617.jpg
(0.107059) imgsizer.img[do_cache]:

all values above are correct until the imgsizer.img[cache_path] comes into play.

       
MarcinM's avatar
MarcinM
17 posts
16 years ago
MarcinM's avatar MarcinM

Hi,

I got some strange issue:

{exp:imgsizer:size src="{cell_photo}" width="130"}
    {sized}
{/exp:imgsizer:size}

it works ok with creating small photos (I can see them via FTP), but it’s not ok with [browser_out_path], witch looks like:

(0.491901) imgsizer.img[browser_out_path]: /imagessizedimageshotele_i_apartamentyHotelObereggen_bar-130x85.jpg

After first / all other are missing. Should be:

(0.491901) imgsizer.img[browser_out_path]: /images/sized/images/hotele_i_apartamenty/HotelObereggen_bar-130x85.jpg

Any idea what’s wrong? (Imgresizer version 2.5.6, EE 1.6.7 Build: 20090515)

       
First 30 31 32 33 34 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.