We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1764
    • 680 Posts
    This is an auto-generated support/comment thread for Auto Image Resizer.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Finds <img> tags in the output then caches and resizes their image files for better image quality and download time.
      • 2347
      • 3 Posts
      I think I’m missing something.

      I copied the code to a plugin. I check "OnWebPagePrerender" under System Events tab.

      Then when I load a page with a resized image (in Editor) the page doesn’t load and I get a blank page. When I disable or uncheck "OnWebPagePrerender" the page loads normally. When "unchecked "OnWebPagePrerender" the resized image is the default one (resized by the browser)

      I’ve checked that gd2 is installed correctly, I’m using modxcms 0.9.6

      I need desperately a script for autoresizing images (and I’m sure this one is the one I need and that I’m doing something wrong).
        • 6726
        • 7,075 Posts
        Thanks a lot Adam grin

        For those of us who have the GD library (that would be most server now I guess) it might be a lighter solution than the very nice DirectResize which uses the fastimagecopyresampled function and the GifInfo class.

        I will definitely test it out and compare !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 31227
          • 198 Posts
          more details please. Added the plugin, i set the OnWebPagePrerender and nothing happens. The folder is empty, the size of the images is the same. Thanks!
            Pure MODx sites
            Viriko.ru & Viriko.com - Multilingual and running on 1 MODx
            • 7129
            • 3 Posts
            Quote from: Vait at Nov 12, 2007, 07:06 PM

            more details please. Added the plugin, i set the OnWebPagePrerender and nothing happens. The folder is empty, the size of the images is the same. Thanks!

            I`ve had the same experience - nothing happened (no changes, no thumbnails). Thanks.
              • 320
              • 1 Posts
              Found the problem. Script checks if the URI to load the image from is site-local (for whatever reason). If you disable this check, everything works fine. You can find the check here:

               //make sure that the picture exists
                              if(strpos(strtolower($temp),
              strtolower($siteURL)) !== false && $handle  !== false){
              


              should be:

               //make sure that the picture exists
                              if($handle  !== false){
              

              I really can’t see why the script would check for site-local files (apart from possible exploits in GD triggered by malicious remote images; we’ve seen that before) since getimagesize() etc. should really work fine on remote URLs.
                • 28338
                • 46 Posts
                I’m having some problems with this plugin. The cached image is just a black box. GD version is "2.0 or higher".

                I see that this plugin hasn’t been updated for a while. If another plugin exists that perform the same function I would appreciate a push in the right direction.

                I’m running MODx 1.0.0.

                Edit: Looked around and settled on phpThumb which seem to work.
                  • 28148
                  • 6 Posts
                  Just for the case anybody has customers like I have, who just don’t care about the aspect ratio. Here’s a little fix to the code, so it does cache such non-uniformly resized pictures:

                  Change line 117 from
                  if($height != $cacheHeight && $width != $cacheWidth){


                  to
                  if($height != $cacheHeight || $width != $cacheWidth){


                  The original code would check on a difference in both, width and height, while this little change produces a cached image as soon as one of them is different.

                  btw. is anybody actively working on this plugin?

                  Regards from Austria (mountains, no kangaroos wink)
                    • 3316
                    • 28 Posts
                    This plugin works perfectly if you use the fix from post #6 above. I am using 1.0.3.
                      • 21980
                      • 6 Posts
                      Hi,

                      There’s a little problem, if one of height or width is not defined, the plugin don’t do his job.
                      So I’ve made a little modification, but you still have to define one.

                      Enjoy.