We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I see what the problem is: there's a missing slash between Documents and assets in the path /Library/WebServer/Documentsassets/havsvidden2.jpg, which was causing phpThumb to not find the file. /Library/WebServer/Documents may not be the right place for it to be looking either.

    Could you tell me what your MODX_BASE_PATH is set to? One way to find it is to look in core/config/config.inc.php on line 46 you should see $modx_base_path= with the value.

    It looks like you have MODX installed in /Users/williamastrom/Development/test.dev/public/. Is the original image in /Users/williamastrom/Development/test.dev/public/assets/, or is it in some other directory?

    I'll think about this tonight. I've tried to make the path handling code more robust than it was, but looks like I've missed something and your particular configuration falls into this hole. I have an idea what it might be, but if you'll give me some more details on your configuration I'll get it fixed so nobody runs into this in the future. Obviously it should be working, especially if phpThumbOf did!
      Extras :: pThumbResizerimageSlimsetPlaceholders
      • 36562
      • 94 Posts
      My base path is : "/Users/williamastrom/Development/test.dev/public/".
      Correct, i just put the image in assets/. So it would be /Users/williamastrom/Development/test.dev/public/assets/image

      Unfortunately i am running this on my mac, and i bought my first one ever only 3 weeks ago, so im not really in control over my environment yet:) But let me know if you want any other info and ill try sort it for you.

      Always fun looking for things that should work:)

      /w
        --------------------------------------
        www.williamastrom.se
        • 36562
        • 94 Posts
        My base path is : "/Users/williamastrom/Development/test.dev/public/".
        Correct, i just put the image in assets/. So it would be /Users/williamastrom/Development/test.dev/public/assets/image

        Unfortunately i am running this on my mac, and i bought my first one ever only 3 weeks ago, so im not really in control over my environment yet:) But let me know if you want any other info and ill try sort it for you.

        Always fun looking for things that should work:)

        /w
          --------------------------------------
          www.williamastrom.se
          • 36562
          • 94 Posts
          Hmm. Seems like there is some kind of issue in modphpthumb.class when im in the mgr context.. So i need to add a slash to the path... But even if i do, it is the wrong path its trying to get the file from.

          its not in /Library/WebServer/Documentsassets/havsvidden2.jpg, but in Users/williamastrom/Development/test.dev/public/assets/

          Unfortunately i don't have any time right now to dig in to it, but maybe you know what it is who has been working with it more.

          Edit: Obviously that library/webserver.... is the doc root ( $_SERVER['DOCUMENT_ROOT'] ). [ed. note: DesignByWilliam last edited this post 10 years, 5 months ago.]
            --------------------------------------
            www.williamastrom.se
          • Yes, I think it's something along those lines. I've got an idea what and how to fix it. I'll look at it tonight..
              Extras :: pThumbResizerimageSlimsetPlaceholders
              • 36562
              • 94 Posts
              Quote from: jgrant at Nov 04, 2013, 10:42 PM
              Yes, I think it's something along those lines. I've got an idea what and how to fix it. I'll look at it tonight..

              As i added to the above, seems like it adds the document root to it. And i guess the phpthumb is the cause of that.
                --------------------------------------
                www.williamastrom.se
              • Quote from: DesignByWilliam at Nov 04, 2013, 10:35 PM
                Edit: Obviously that library/webserver.... is the doc root ( $_SERVER['DOCUMENT_ROOT'] ).

                Yep, that's exactly it. If phpThumb is given a relative path, it'll prepend a variable called config_document_root, which defaults to the value of $_SERVER['DOCUMENT_ROOT']. I think most of the time this is the same as MODX_BASE_PATH so it doesn't matter but in your case they're different, meaning phpThumb messes up the file name.

                I've made a fix for it; would you mind giving it a try? Locate core/components/phpthumbof/model/phpthumbof.class.php and replace its contents with this code.

                If you're on GitHub, I've created an issue for this.
                  Extras :: pThumbResizerimageSlimsetPlaceholders
                  • 42802
                  • 96 Posts
                  Sebastian Zahn | ingroove.uy Reply #28, 10 years, 1 month ago
                  Great work!
                  One question, i stop using phpthumbof and installed pthumb, everything works great and the site increased performance, but i´m using Image+ package for image cropping ( in slideshows ) and don´t work with pthumb ( it worked with previous phpthumbof ), is there another solution for client image cropping? Thanks.

                  Sebastian.
                  • Yes, I noticed this myself a few days ago. I think there are two problems.

                    The first is, the new version of phpThumb that came with MODX 2.2.12 may have a bug which causes it not to size thumbnails correctly in this case. (pThumb just passes off the input image and parameters to either phpThumb or Resizer to do the actual work). I haven't looked into this one really.

                    But Resizer doesn't work correctly either. It sizes the image to w x h, then tries to crop a sw x sh rectangle image out if it. But it should be the opposite order: crop first, then resize. Anyway, this'll be fixed in the next version. If you want you can replace core/components/resizer/model/resizer.class.php with this version and it should work. Make sure you change the 'Use Resizer' system setting to Yes and clear out any cached images so that they'll be regenerated.
                      Extras :: pThumbResizerimageSlimsetPlaceholders
                      • 42802
                      • 96 Posts
                      Sebastian Zahn | ingroove.uy Reply #30, 10 years, 1 month ago
                      Thanks for your reply jgrant! I appreciate it.

                      I´ll try and tell you the results. Thanks!

                      Sebastian.



                      Quote from: jgrant at Mar 12, 2014, 02:02 PM
                      Yes, I noticed this myself a few days ago. I think there are two problems.

                      The first is, the new version of phpThumb that came with MODX 2.2.12 may have a bug which causes it not to size thumbnails correctly in this case. (pThumb just passes off the input image and parameters to either phpThumb or Resizer to do the actual work). I haven't looked into this one really.

                      But Resizer doesn't work correctly either. It sizes the image to w x h, then tries to crop a sw x sh rectangle image out if it. But it should be the opposite order: crop first, then resize. Anyway, this'll be fixed in the next version. If you want you can replace core/components/resizer/model/resizer.class.php with this version and it should work. Make sure you change the 'Use Resizer' system setting to Yes and clear out any cached images so that they'll be regenerated.