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

jbcobbs's avatar
jbcobbs
53 posts
16 years ago
jbcobbs's avatar jbcobbs

That does not help because if it is a portrait image, I do not want it resized to the same dimension as I would want the width resized to. I actually used the phpthumb as I referenced in the last post and it has a setting specifically for landscape or portrait images which worked perfectly.

       
awsadmin's avatar
awsadmin
127 posts
16 years ago
awsadmin's avatar awsadmin

Hello, I’m on ee 1.6.7 and have been using img sizer fine for about 2 yrs up to version 2.5.2. I recently moved my ee to a new server and now img sizer breaks my page (comes up blank) if I am using the tag. I upgraded to the latest version of img sizer 2.5.6, still same problem. Has this happened to anyone else? If I refer to the image with just the <img> tag the image shows fine. Only when using the img sizer tag.

UPDATE problem solved I don’t have GD installed on my server

       
sambo's avatar
sambo
80 posts
16 years ago
sambo's avatar sambo

Can I somehow use the plugin in an extension? I am writing a simple extension that could use the functionality of the plugin. I use the plugin in every EE installation and would love to be able to use it in my extension to create thumbnails in the EE Control Panel.

I know how to call methods in plugins but I don’t see how I could pass in the same data as the EE tag does.

Does the EE Control Panel maybe have some built in functions to create and cache thumbnails?

Best, Sammi

       
VRDL's avatar
VRDL
23 posts
about 16 years ago
VRDL's avatar VRDL

I’ve slightly modified the plugin, added the variable crop=”no” (yes by default, as it was).

You can now specify a width and a height and resize it without a crop proportionally.

{exp:imgsizer:size src="{src}" width="194" height="120" crop="no"}
{sized}
{/exp:imgsizer:size}

You have an image: 495 x 180 will resize to 194 x 71 You have an image: 52 x 56 will not resize You have an image: 100 x 300 will resize to 40 x 120

There you go 😊

What did I do: I replaced:

// -------------------------------------
            // Do we want to Crop the image?
            // -------------------------------------
            if($max_height != '9000' && $max_width != '9000' && $max_width != $max_height)
            {
                $img['crop'] = "yes";
                $img['proportional'] = false;
                $img['out_width'] = $max_width;
                $img['out_height'] = $max_height;
            }

By:

$crop = strtolower(( ! $TMPL->fetch_param('crop')) ? 'yes' : $TMPL->fetch_param('crop'));
        if($crop == "yes"){
            // -------------------------------------
            // Do we want to Crop the image?
            // -------------------------------------
            if($max_height != '9000' && $max_width != '9000' && $max_width != $max_height)
            {
                $img['crop'] = "yes";
                $img['proportional'] = false;
                $img['out_width'] = $max_width;
                $img['out_height'] = $max_height;
            }
        }
       
heaversm's avatar
heaversm
197 posts
about 16 years ago
heaversm's avatar heaversm

I started getting this error all of the sudden:

Warning: getimagesize(/home/users/web/b1247/solidgold/) [function.getimagesize]: failed to open stream: Permission denied in /hermes/web01c/b1247/solidgold/manage/plugins/pi.imgsizer.php on line 151

Any idea how to fix that? I checked the permissions on my image directories and they’re all fine.

       
heaversm's avatar
heaversm
197 posts
about 16 years ago
heaversm's avatar heaversm

Scratch that - still getting this error. For some reason whenever it caches images, the permissions error pops up…

       
dragonhiro's avatar
dragonhiro
7 posts
about 16 years ago
dragonhiro's avatar dragonhiro
@dragonhiro it works fine with eeFlickr here is a code example that does 100px squares insted of 75px
{exp:eeflickr:photos_search  user_id="47282007@N00" page="page2" per_page="16"}
    {eeflickr:photos_search_loop}  
          {exp:imgsizer:size remote="on" src="http://farm{farm}.static.flickr.com/{server}/{id}_{secret}.jpg"  width="100" height="100" alt=""}
    {/eeflickr:photos_search_loop}
{/exp:eeflickr:photos_search}

Hi Lumis

Unfortunately the code above does not work for me. I get nothing showing up on the page and nothing being placed in my cache folder!

This is what i get from the template debugger:

(0.656324)      Calling Class/Method: Imgsizer/size
(0.656382)       -> Class Called: Imgsizer
(0.656396)       -> Method Called: size
(0.656428)      imgsizer.user.src: <img src="http://farm4.static.flickr.com/8888/number_obscured.jpg" alt=""  />
(0.656477)      imgsizer.img[src]: /8888number_obscured.jpg
(0.656485)      imgsizer.img[base_path]: /home/signalscom/public_html/
(0.657610)      20823042
(2.655594)      imgsizer.img_full_path: /home/signalscom/public_html/
(2.655983)      imgsizer.img[base_rel_path]: /
(2.656054)      imgsizer.full_pathinfo dirname: /home/signalscom
(2.656065)      imgsizer.full_pathinfo basename: public_html
(2.656076)      imgsizer.full_pathinfo filename: public_html
(2.656087)      imgsizer.Error: image mime type does not match ok mime types
(2.656105)      Returning No Results Content

I REALLY want to get this working, so any help would be fantastic!

       
daithi's avatar
daithi
38 posts
about 16 years ago
daithi's avatar daithi
I’ve slightly modified the plugin, added the variable crop=”no” (yes by default, as it was). You can now specify a width and a height and resize it without a crop proportionally.

Just want to say a big thanks for this tweak. It makes a huge difference to me.

       
rmeder's avatar
rmeder
97 posts
about 16 years ago
rmeder's avatar rmeder

I am receiving the following errors from the imgsizer plugin:

Warning: Division by zero in /www/public_html/system/plugins/pi.imgsizer.php on line 490 Warning: Division by zero in /www/public_html/system/plugins/pi.imgsizer.php on line 490 Warning: Invalid argument supplied for foreach() in /www/public_html/system/plugins/pi.imgsizer.php on line 237 Notice: Undefined index: out_width in /www/public_html/system/plugins/pi.imgsizer.php on line 314 Notice: Undefined index: out_height in /www/public_html/system/plugins/pi.imgsizer.php on line 314

Everything appears to be working ok, and this plugin has been running for a long time without any issues. I am not sure if perhaps it started with one of the last couple upgrades.

Any assistance would be greatly appreciated.

Thanks,

Rick

       
dragonhiro's avatar
dragonhiro
7 posts
about 16 years ago
dragonhiro's avatar dragonhiro
Hi Lumis Unfortunately the code above does not work for me. I get nothing showing up on the page and nothing being placed in my cache folder! I REALLY want to get this working, so any help would be fantastic!

Finally found the solution… just waiting for it to be implemented.

Turns out my server is running a firewall and although the host has allowed flickr.com through, all images are stored under farm#.static.flickr.com which is not currently allowed through. I’ve asked this to be added and hopefully this will solve the problem.

Just to make sure it was only that i’ve tested using the Google logo (google.com is allowed through the firewall) and the imgsizer works fine, so hopefully this will be an end to my problems.

       
Blue Coast Web's avatar
Blue Coast Web
32 posts
about 16 years ago
Blue Coast Web's avatar Blue Coast Web

Hi, this plugin looks to be exactly what I’m looking for, but there’s one thing I’m still interested in.

Can I wrap the tags around an EE include that may or may not include an image?

For example, I have three blog fields that populate my homepage. The first field is the main article picture or video, the second is the article summary (before the jump), and the last field is the rest of the article (after the jump).

I’d like to have something automatically resize any image put in to the first field (which we’ll call summary).

Ideally:

{exp:imgsizer:size auto="425" crop="no"}
    {summary}
{/exp:imgsizer:size}

This would simply resize any image placed in {summary} to 425px in width if it were larger than that.

Obviously my syntax isn’t complete, but I don’t know how to do it. My problem is that I don’t know the <img> tag parameters since there may or may not be there.

Is this possible?

       
Scheffey's avatar
Scheffey
24 posts
about 16 years ago
Scheffey's avatar Scheffey

First off, Verdel, thank you for the modification. It has worked beautifully so far. Lumis, I’d consider adding this functionality to your official version. It is very helpful.

@bcw You are missing a required element in your example, the “src” parameter. Without the source, imgsizer doesn’t know what to resize. Unfortunately, {summary} may or may not be a valid image path so dropping that in as the source would not be safe.

       
misc's avatar
misc
54 posts
about 16 years ago
misc's avatar misc

The plugin seems to work, but I am not sure what is going on.

It creates the following directory structure:

/images/sized/images/sized/remote/

and only in the last remote-directory files are saved.

What could the reason be?

Thank you MISC

       
jbcobbs's avatar
jbcobbs
53 posts
about 16 years ago
jbcobbs's avatar jbcobbs

After switching to MSM my images stopped showing up. If you look in the code of the rendered page, image tags are gone. The code below references http://feastoflittleitaly.com/Entertainment which is the default site. If I delete the new site that I was trying to add then everything works. So with MSM = image sizer doesnt work. I also use phpthumb and that doesnt work either after the addition of another site.

I get this in debugging too:

(0.107993) Beginning Final Tag Data Processing (0.108006) Calling Class/Method: Imgsizer/size (0.108072) -> Class Called: Imgsizer (0.108086) -> Method Called: size (0.108129) imgsizer.user.src: (0.108158) imgsizer.Error: no src provided for imagesizer (0.108180) Returning No Results Content (0.108190) -> Data Returned (0.108213) Calling Class/Method: Imgsizer/size (0.108260) -> Class Called: Imgsizer (0.108273) -> Method Called: size (0.108301) imgsizer.user.src: (0.108326) imgsizer.Error: no src provided for imagesizer (0.108339) Returning No Results Content (0.108348) -> Data Returned (0.108374) - End Tag Processing -

{embed="embeds/head"}
<div id="container">
    {embed="embeds/header2"}
{embed="embeds/sidebar"}
<div id="mainContent">

<div id="entertainment_header">

{exp:weblog:entries  weblog="sponsors" search:sponsor_details="entertainment_sponsor"}
{exp:imgsizer:size src="{sponsor_logo}" width="200"}{/exp:weblog:entries}<h4>Entertainment Stage</h4>
</div>

<div id="entertainment_header">
{exp:weblog:entries weblog="festival_setup"}
<h3>{festival_date_1 format="%l, %F %j %Y"}</h3>
{/exp:weblog:entries}
</div>

<div id="entertainment_schedule_headliner">
{exp:weblog:entries weblog="entertainment" search:event_type="=headliner" search:event_day="=1"}
<ul>
{exp:imgsizer:size src="{event_image}" width="200"}
<h2>Headliner {event_date format="%g:%i %a"}</h2>
<h1>{title}</h1>
</ul>
</div>
<div id="entertainment_schedule">
{/exp:weblog:entries}
{exp:weblog:entries weblog="entertainment"  orderby="event_date"  sort="asc|desc" search:event_day="=1"}
<ul>
{exp:imgsizer:size src="{event_image}" width="150"}<h2>{event_date format="%g:%i %a"}</h2>
<h1>{title}</h1>


</ul>
{/exp:weblog:entries}
</div>


<div id="entertainment_header">
{exp:weblog:entries weblog="festival_setup"}
<h3>{festival_date_2 format="%l, %F %j %Y"}</h3>
{/exp:weblog:entries}
</div>

<div id="entertainment_schedule_headliner">
{exp:weblog:entries weblog="entertainment" search:event_type="=headliner" search:event_day="=2"}
<ul>
{exp:imgsizer:size src="{event_image}" width="200"}
<h2>Headliner {event_date format="%g:%i %a"}</h2>
<h1>{title}</h1>
</ul>
</div>
<div id="entertainment_schedule">
{/exp:weblog:entries}
{exp:weblog:entries weblog="entertainment"  orderby="event_date"  sort="asc|desc" search:event_day="=2"}
<ul>
{exp:imgsizer:size src="{event_image}" width="150"}<h2>{event_date format="%g:%i %a"}</h2>
<h1>{title}</h1>


</ul>
{/exp:weblog:entries}
</div>



<div id="entertainment_header">
{exp:weblog:entries weblog="festival_setup"}
<h3>{festival_date_3 format="%l, %F %j %Y"}</h3>
{/exp:weblog:entries}
</div>

<div id="entertainment_schedule_headliner">
{exp:weblog:entries weblog="entertainment" search:event_type="=headliner" search:event_day="=3"}
<ul>
{exp:imgsizer:size src="{event_image}" width="200"}
<h2>Headliner {event_date format="%g:%i %a"}</h2>
<h1>{title}</h1>
</ul>
</div>
<div id="entertainment_schedule">
{/exp:weblog:entries}
{exp:weblog:entries weblog="entertainment"  orderby="event_date"  sort="asc|desc" search:event_day="=3"}
<ul>
{exp:imgsizer:size src="{event_image}" width="150"}<h2>{event_date format="%g:%i %a"}</h2>
<h1>{title}</h1>


</ul>
{/exp:weblog:entries}
</div>

<!-- end #mainContent -->
{embed="embeds/footer"}
       
ryanisinallofus's avatar
ryanisinallofus
6 posts
about 16 years ago
ryanisinallofus's avatar ryanisinallofus

Your site says this crops images but it doesn’t. It’s a great plugin and thanks for releasing it but maybe you could change the wording on your site? Copping and resizing are very different things.

       
First 33 34 35 36 37 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.