We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    devolute, yes, there is a System Setting that you can change for those.
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • Posts
      Great, thanks splittingred.

      I'm having real trouble finding it tho! can you give me a pointer? Thanks.
        • 28215
        • 4,149 Posts
        Search for "phpthumb" in the System Settings. I can't remember offhand what it is.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 21508
          • 46 Posts
          phpThumbOf for subdomain
          context specific settings:


          • base_path = /home/test/public_html/demo (Set it to the absolute document root path you would like to use.)
          • phpthumbof.assets_url = /
          • phpthumbof.cache_path = {base_path}/cache/
          • phpthumb_document_root = {base_path}
          • phpthumb_allow_src_above_docroot = 1 (Yes)

          I think that would help, that may be missing something (but I think not)
            It’s Nice to Be Important, But It’s More Important to Be Nice
            • 33987 ☆ A M B ☆
            • 197 Posts
            Shaun, could you make it a setting so we can generate thumbs without a hashed filename? Currently the whole thing is hashed using md5, which is bad for search engines. By default, we change phpthumbof snippet to skip the file-hash:

            $cacheFilename = md5($inputSanitized);

            to:

            $cacheFilename = $inputSanitized;

            This way the real filename still is displayed in the cached filename.
              Sterc Internet & Marketing | MODX Founding Partner | Chairman of the MODX Advisory Board

              In need of a MODX consult? Try our MODX Developers Experts!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I've cloned a remote site onto my localhost for development. Everything works fine except for phpthumbof. It just loads its little warning image about remote thumbnailing or some such thing instead of the expected page on the front-end.

              I completely removed the phpthumbof package, downloaded it fresh from the modx repository, installed it, and everything worked just fine, until I logged out of the Manager and logged in again. Immediately all I got was the same image with the error message. It seems to work OK until I try to load the page again, either directly or via the View menu.

              I know my paths are all good, my urls are all good (this installation is in a subdirectory), everything is working just fine without phpthumbof (except, of course for the unmodified appearance of the images that need manipulating). Any suggestions?
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                phpthumbof 1.3.0, MODx Revo 2.2.0

                As far as I can tell, setting the phpthumb_document_root in the system settings has no effect. By default it uses the $_SERVER['DOCUMENT_ROOT'] value.

                Caches cleared, cookies cleared, nothing changes the config_document_root that the phpthumb class prepends to the filename it's passed.

                An image TV has the base_path prepended to its media source path automatically. This mean that if a site is installed in a subdirectory the subdirectory name is being doubled.

                /www/modx//modx/assets/images/image.png

                Setting the phpthumb_document_root to something like /www should solve the problem, but it has no effect.

                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 35844
                  • 15 Posts
                  I'm at a bit of a loss as to how to get phpThumbOf working, I have a Debian box with the Imagemagick PHP extensions installed (and verified with "phpInfo();"), however using phpthumbof as an output filter yields no result whatsoever.

                  <img src="[[+tv.example:phpthumbof=`w=93&h=62&f=png`]]" alt="[[+tv.other]]">


                  The TV is outputting plain text, and the phpThumbOf cache folder exists and is world-writable at the moment. The image is displayed directly from the source URL and is not parsed through phpThumb whatsoever.

                  Can anyone give me some suggestions?

                  EDIT: I've found that my working on a local file it will work perfectly, the problem was with using offsite images from my CDN, even though the settings reflected allowing offsite rendering. So I guess this is my new issue, any suggestions with that?

                  EDIT, Take 2: Having started getting all my MODX sites to 2.2 I'm going to look for a different approach taking advantage of the S3 Support built into phpThumbOf. Take this post as solved. [ed. note: RLB last edited this post 14 years, 7 months ago.]
                    • 40045
                    • 534 Posts
                    Don't know how useful it is, but I'll share it anyways...

                    I'm on Revo 2.2.1pl and phpThumbOf 1.3.2 and also have a multi context (multidomain) site with different media sources for each context (because the assets/media/ folder is different) where I pull images from to use them with phpthumbof. I first had the wrong cache path problem and found this thread. Some of the suggestions were good, but I didn't need all of them.

                    So here's what I needed to do to make phpthumbof work:

                    Set 2 context settings

                    phpthumbof.assets_url = assets/cache/phpthumbof/ 


                    I have an "assets" folder in each domain folder, in there is a "cache" folder which should be the target folder for phpthumbof.

                    phpthumbof.cache_path = /home/accountname/public_html/mainsitename/addomains/othercontextfolder/assets/cache/phpthumbof/cache/


                    absolute path to the desired cache folder


                    that's it, seems to work^^

                    somewhere a "cache/" gets added to the path, but I don't know where it's coming from, so I hava a bit of redundancy in my folder structure because of that...it would be perfect if the cached thumbs would be saved in the folder "cache/phpthumbof/" and not "cache/phpthumbof/cache", but the last cache folder get's created anyways, so I had the choice of having a ton of cryptic files (the converted thumbs) in the main "cache/" folder or I would do the "cache/phpthumbof/" thing and have a cache folder in there again...I did the second =) [ed. note: last edited this post 14 years, 4 months ago.]
                      • 14372
                      • 49 Posts
                      Anyone having problems getting Amazon S3 and phpThumbOf to work? When I turn the feature on in settings the whole site goes down and this php error is displayed ...

                      PHP Fatal error:  Class 'CFRuntime' not found in /home/insert_path_here/public_html/core/components/phpthumbof/model/aws/services/s3.class.php on line 69


                      Any ideas?

                      My reference was http://rtfm.modx.com/display/ADDON/phpThumbOf for the settings.

                      Ps: I have a custom domain so I set the CNAME to my custom domain