ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

plugin: ED Image Resizer EE2

July 14, 2010 8:56pm

Subscribe [9]
  • #1 / Jul 14, 2010 8:56pm

    aimelise

    31 posts

    The old thread for Ed Image Resizer is closed, so I’d like to start one here.  Erksine Design’s Image Sizer Plugin for EE2 is here.

    I’m running EE2.1 (Build 20100712) and wondering if my full server path is correct in pi.ed_imageresizer.php.

    Under Admin > General Configuration my “themes” path is:
    /home/barnett/public_html/themes

    So does that mean this is correct?  My cache image directory is 777’d.

    private $server_path        = '/home/barnett/public_html';                 // no trailing slash
        
    private $cache_path         = '/home/barnett/public_html/images/sized/';   // with trailing slash

    I’m testing the image sizer here with this code and nothing is showing up.

    {exp:channel:entries channel="products" category_group="1" category="1" dynamic="no" show_future_entries="yes" orderby="product-reorder" sort="asc"}
    
    
    {title}
    
    
    {photo-1}
    
    
    ***Insert resized image below ****
    
    {exp:ed_imageresizer image="{photo-1}" maxWidth="70"}  
    
    ***End resized image***
    
    
    
    
    
    {/exp:channel:entries}

    My images are just not showing up.  Another person was having the same issue w/ his images not showing up.  He tried both Lumis’ and ED’s and got the Lumis version to work.  That thread is here.

  • #2 / Jul 14, 2010 9:39pm

    aimelise

    31 posts

    I’m working w/ a developer who added some lines of code to accomodate for this dev environment not being on a TLD (top level domain).

    He commented out line 79:

    $this->image          = $this->EE->typography->parse_file_paths(preg_replace('/^(s?f|ht)tps?:\/\/[^\/]+/i', '', (string) html_entity_decode($this->EE->TMPL->fetch_param('image'))));

    He changed line 80 to:

    $this->image          = $this->EE->typography->parse_file_paths(preg_replace('/http:\/\/209.51.143.196\/~barnett\//', '', (string) html_entity_decode($this->EE->TMPL->fetch_param('image'))));

    He changed line 395 to:

    $this->image_tag .= 'src="/~barnett/'.$image_path.'" >';

    Hopefully this will help someone if you’re not working from a top-level domain.

  • #3 / Aug 14, 2010 8:22pm

    erfi75

    34 posts

    I’m replying to your post as I’ve had a similar issue with ed_imageresizer. (Incidentally, I’m at wit’s end. I’ve tried to get three different image resizers (lumis imgsizer, ed_imageresizer, and teemthumb) to work on my site (EE 2.1, 20100805)).

    Using debugging, I keep getting this error:

    A PHP Error was encountered
    
    Severity: Warning
    
    Message: mkdir() [function.mkdir]: No such file or directory
    
    Filename: ed_imageresizer/pi.ed_imageresizer.php
    
    Line Number: 124

    Line Number 124-125 says of the php file says:

    if(!mkdir($this->cache_path, 0755)){
                    return array(false, 'fatal', 'Cache path is does not exist and cannot be created. Path: '.$this->cache_path);
                }

    But I’ve set the path as instructed, and can assure everyone the folders I’ve nominated as cache do exist.

    Has anyone got any hints? I wish the plugins had slightly more instructions…

    Eric

  • #4 / Aug 17, 2010 9:01am

    e-man

    1816 posts

    The ED_imagesizer from the old thread worked for me. The current one on Github still gives me errors though.

    As an alternative check out the venerable PHP Thumb.

    There’s an excellent 2-part article on using it with EE2 here:
    part 1: http://digitaldrivel.com/archive/using-phpthumb-in-expressionengine-part-1
    part 2: http://digitaldrivel.com/archive/using-phpthumb-in-expressionengine-part-2

  • #5 / Aug 17, 2010 9:21am

    Cem Meric

    210 posts

  • #6 / Nov 08, 2010 10:53pm

    [email protected]

    119 posts

    I’m having some issues with this plugin as well. The install went well and without issue, but when trying to use it my website keeps throwing this error up on the page that the plugin is used:

    Fatal error: Call to a member function remove_double_slashes() on a non-object in /var/www/vhosts/nmsi.org/ee_system/expressionengine/third_party/imgsizer/pi.imgsizer.php on line 58

    Any idea what could be causing this and or how can fix. Would truly appreciate any help people can provide, thanks!

    Nate

  • #7 / Feb 21, 2011 7:33pm

    SiteGoals

    15 posts

    I’m assuming you all put the plugin file inside of a folder called “ed_imageresizer”. Beyond that I haven’t had any real problems with the plugin and it’s working great for me. Or at least it was…

    I’m using the plugin to resize member photos. The problem is that when a member removes and updates their existing member photo, it goes back to the cached image they originally removed. The new image is on the server in the right place, but apparently because ED Image Sizer is seeing the same filename (photo_[member id].jpg) it defaults back to the original cached image. I verified this by uploading a photo with a different extension, and I got the new resized photo.

    I’m not sure what the solution would be.

  • #8 / Mar 29, 2011 4:42pm

    David Hyland

    210 posts

    I’m assuming you all put the plugin file inside of a folder called “ed_imageresizer”. Beyond that I haven’t had any real problems with the plugin and it’s working great for me. Or at least it was…

    I’m using the plugin to resize member photos. The problem is that when a member removes and updates their existing member photo, it goes back to the cached image they originally removed. The new image is on the server in the right place, but apparently because ED Image Sizer is seeing the same filename (photo_[member id].jpg) it defaults back to the original cached image. I verified this by uploading a photo with a different extension, and I got the new resized photo.

    I’m not sure what the solution would be.

    Hi there, did you find a solution to this caching issue?

    EDIT: changing plugin to the old classic lumis imgsizer does the trick.

  • #9 / Mar 29, 2011 5:55pm

    SiteGoals

    15 posts

    Yes, I did find a solution! I changed the plugin file, around line 188 to this:

    if (file_exists($this->resized)) {
    
         // checks the time of original image before assuming it's the same as cached
         if(@filemtime($this->server_path . $this->image) < @filemtime($this->resized)) {
              return $this->_compileImgTag();
         }
    }
  • #10 / Mar 29, 2011 6:12pm

    David Hyland

    210 posts

    That’s awesome, thank you!

  • #11 / Aug 16, 2011 6:32am

    Wil Linssen

    49 posts

    Hi all
    I’ve just released a patch to the image resizer to address this issue, thanks for flagging it up. And if you have any problems in the future, feel free to drop us an issue on GitHub.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases